How to use the pywebostv.controls.process_payload 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_process_payload(self):
        payload = {
            "level1": {
                "level2": [1, 3],
                "level2a": lambda *a, **b: "{}{}".format(len(a), len(b))
            },
            "level1a": {1, 2}
        }
        expected = {
            "level1": {
                "level2": [1, 3],
                "level2a": "22"
            },
            "level1a": {1, 2}
        }
        assert process_payload(payload, 1, 2, a=4, b=5) == expected
github supersaiyanmode / PyWebOSTV / tests / test_controls.py View on Github external
def test_just_callable_arg(self):
        assert process_payload(lambda x: x**2, 2) == 4