How to use the pywebostv.connection.WebOSClient.discover 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_connection.py View on Github external
def test_discovery(self):
        def mock_discover(*args, **kwargs):
            return ["host1", "host2"]
        backup = pywebostv.connection.discover
        pywebostv.connection.discover = mock_discover

        expected = ["ws://{}:3000/".format(x) for x in ["host1", "host2"]]
        assert [x.url for x in WebOSClient.discover()] == expected

        pywebostv.connection.discover = backup