Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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