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_mute(self):
client = WebOSClient("ws://a")
media = MediaControl(client)
media.mute(True)
self.assert_sent_message_without_id({
"type": "request",
"uri": "ssap://audio/setMute",
"payload": {"mute": True}
})
def test_volume_down(self):
client = WebOSClient("ws://a")
media = MediaControl(client)
media.volume_down()
self.assert_sent_message_without_id({
"type": "request",
"uri": "ssap://audio/volumeDown"
})
def set_volume(self):
client = WebOSClient("ws://a")
media = MediaControl(client)
media.set_volume(30)
self.assert_sent_message_without_id({
"type": "request",
"uri": "ssap://audio/setVolume",
"payload": {"volume": 30}
})
def test_unmute(self):
client = WebOSClient("ws://a")
media = MediaControl(client)
media.mute(False)
self.assert_sent_message_without_id({
"type": "request",
"uri": "ssap://audio/setMute",
"payload": {"mute": False}
})
def test_volume_up(self):
client = WebOSClient("ws://a")
media = MediaControl(client)
media.volume_up()
self.assert_sent_message_without_id({
"type": "request",
"uri": "ssap://audio/volumeUp"
})
def get_control(self, controltype):
if controltype not in self.clients:
if controltype == 'media':
control = MediaControl(self.client)
elif controltype == 'input':
control = InputControl(self.client)
control.connect_input()
elif controltype == 'system':
control = SystemControl(self.client)
elif controltype == 'source':
control = SourceControl(self.client)
self.clients[controltype] = control
return self.clients[controltype]