Skip to content

Commit

Permalink
Add some state detection tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffLIrion committed Sep 4, 2019
1 parent b53121c commit dad96fb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/test_androidtv.py
Expand Up @@ -632,6 +632,12 @@ def test_state_detection(self):
"""
self.atv.max_volume = 60.
self.assertUpdate([False, False, -1, None, None, None, None, None, None],
(constants.STATE_OFF, None, None, None, None))

self.assertUpdate([True, False, -1, None, None, None, None, None, None],
(constants.STATE_IDLE, None, None, None, None))

self.assertUpdate([True, True, 2, 'com.amazon.tv.launcher', 3, constants.STATE_IDLE, 'hmdi_arc', False, 30],
(constants.STATE_PLAYING, 'com.amazon.tv.launcher', 'hmdi_arc', False, 0.5))

Expand Down
9 changes: 9 additions & 0 deletions tests/test_firetv.py
Expand Up @@ -278,6 +278,15 @@ def test_state_detection(self):
"""Check that the state detection works as expected.
"""
self.assertUpdate([False, None, -1, None, None, None],
(constants.STATE_OFF, None, None))

self.assertUpdate([True, False, -1, None, None, None],
(constants.STATE_IDLE, None, None))

self.assertUpdate([True, True, 1, "com.amazon.tv.launcher", None, None],
(constants.STATE_STANDBY, "com.amazon.tv.launcher", ["com.amazon.tv.launcher"]))

self.assertUpdate([True, True, 1, constants.APP_NETFLIX, 3, [constants.APP_NETFLIX]],
(constants.STATE_PLAYING, constants.APP_NETFLIX, [constants.APP_NETFLIX]))

Expand Down

0 comments on commit dad96fb

Please sign in to comment.