Skip to content

Commit

Permalink
Test for send_pronto added.
Browse files Browse the repository at this point in the history
  • Loading branch information
syssi committed Jan 28, 2018
1 parent 5f86165 commit 82d85ae
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions miio/tests/test_chuangmi_ir.py
Expand Up @@ -9,6 +9,13 @@
'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABFEBAQEBAQEBAgICAgIC' \
'AgEBAgECAQEBAQIBAgECAgICBgNXA1cDUA'

PROSONIC_POWER_ON_PROTON = '0000006C00220002015B00AD001600160016001600160016' \
'001600160016001600160016001600160016001600160041' \
'001600410016004100160041001600410016004100160041' \
'001600160016001600160041001600160016004100160016' \
'001600160016001600160016001600410016001600160041' \
'001600160016004100160041001600410016004100160623' \
'015B005700160E6E'

class DummyChuangmiIr(DummyDevice, ChuangmiIr):
def __init__(self, *args, **kwargs):
Expand Down Expand Up @@ -60,3 +67,11 @@ def test_read(self):
def test_play(self):
assert self.device.play(PROSONIC_POWER_ON) is True
assert self.device.play(PROSONIC_POWER_ON, 19200) is True

def test_play_pronto(self):
assert self.device.play_pronto(PROSONIC_POWER_ON_PROTON) is True
assert self.device.play_pronto(PROSONIC_POWER_ON_PROTON, 0) is True
assert self.device.play_pronto(PROSONIC_POWER_ON_PROTON, 1) is True

with pytest.raises(ChuangmiIrException):
self.device.play_pronto(PROSONIC_POWER_ON_PROTON, -1)

0 comments on commit 82d85ae

Please sign in to comment.