def test_notify(self): client = FakeClient() system = SystemControl(client) system.notify("test", block=False) client.assert_sent_message_without_id({ "type": "request", "uri": "ssap://system.notifications/createToast", "payload": {"message": "test"} })
def test_enter(self): client = FakeClient() inp = InputControl(client) inp.enter(block=False) client.assert_sent_message_without_id({ "type": "request", "uri": "ssap://com.webos.service.ime/sendEnterKey", })
def test_set_volume(self): client = FakeClient() media = MediaControl(client) media.set_volume(30, block=False) client.assert_sent_message_without_id({ "type": "request", "uri": "ssap://audio/setVolume", "payload": {"volume": 30} })
def test_unmute(self): client = FakeClient() media = MediaControl(client) media.mute(False, block=False) client.assert_sent_message_without_id({ "type": "request", "uri": "ssap://audio/setMute", "payload": {"mute": False} })
def test_delete(self): client = FakeClient() inp = InputControl(client) inp.delete(4, block=False) client.assert_sent_message_without_id({ "type": "request", "uri": "ssap://com.webos.service.ime/deleteCharacters", "payload": { "count": 4, } })
def test_type(self): client = FakeClient() inp = InputControl(client) inp.type("hello world", block=False) client.assert_sent_message_without_id({ "type": "request", "uri": "ssap://com.webos.service.ime/insertText", "payload": { "text": "hello world", "replace": 0, } })
def test_close(self): client = FakeClient() app = ApplicationControl(client) client.setup_response("ssap://system.launcher/close", {"returnValue": True}) app.close({"123": "435"}) client.assert_sent_message_without_id({ "type": "request", "uri": "ssap://system.launcher/close", "payload": { "123": "435", } })
def test_launch(self): client = FakeClient() app = ApplicationControl(client) client.setup_response("ssap://system.launcher/launch", {"returnValue": True}) application = Application({"id": "123"}) app.launch(application, content_id="1", params={"a": "b"}) client.assert_sent_message_without_id({ "type": "request", "uri": "ssap://system.launcher/launch", "payload": { "id": "123", "contentId": "1", "params": {"a": "b"} } })
def test_commands(self, command, uri): client = FakeClient() system = SystemControl(client) getattr(system, command)(block=False) client.assert_sent_message_without_id({"type": "request", "uri": uri})