How to use the pywebostv.controls.arguments function in pywebostv

To help you get started, we’ve selected a few pywebostv examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github supersaiyanmode / PyWebOSTV / tests / test_controls.py View on Github external
def test_bad_argument_param(self):
        with raises(ValueError):
            arguments(None)

        with raises(ValueError):
            arguments({})
github supersaiyanmode / PyWebOSTV / tests / test_controls.py View on Github external
def test_extract_positional_args(self):
        args = arguments(1)
        assert args([1], {2: 3}, "blah") == {2: 3}

        with raises(TypeError):
            assert args()
github supersaiyanmode / PyWebOSTV / tests / test_controls.py View on Github external
def test_bad_argument_param(self):
        with raises(ValueError):
            arguments(None)

        with raises(ValueError):
            arguments({})
github supersaiyanmode / PyWebOSTV / tests / test_controls.py View on Github external
def test_extract_keyword_args(self):
        args = arguments("arg")
        assert args(arg=1) == 1

        with raises(TypeError):
            assert args()
github supersaiyanmode / PyWebOSTV / tests / test_controls.py View on Github external
def test_args_default_value(self):
        args = arguments(2, default={1, 2})
        assert args() == {1, 2}
        assert args("a", "b", "c") == "c"
github supersaiyanmode / PyWebOSTV / tests / test_controls.py View on Github external
def test_kwargs_default_value(self):
        args = arguments("key", default="value")
        assert args() == "value"
        assert args("a", "b", key="blah") == "blah"
github supersaiyanmode / PyWebOSTV / tests / test_controls.py View on Github external
def test_postprocess(self):
        args = arguments(2, postprocess=lambda x: 1, default={1, 2})
        assert args() == {1, 2}
        assert args("a", "b", "c") == 1