Skip to content

Commit

Permalink
Add tests for device-specific commands (#231)
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffLIrion committed Jan 17, 2021
1 parent e12aff4 commit 88ada41
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/test_androidtv_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ async def setUp(self):
with async_patchers.PATCH_ADB_DEVICE_TCP, async_patchers.patch_connect(True)[self.PATCH_KEY], async_patchers.patch_shell('')[self.PATCH_KEY]:
self.atv = AndroidTVAsync('HOST', 5555)
await self.atv.adb_connect()
self.assertEqual(self.atv._cmd_get_properties_lazy_no_running_apps, constants.CMD_ANDROIDTV_PROPERTIES_LAZY_NO_RUNNING_APPS)

@awaiter
async def test_turn_on_off(self):
Expand Down
1 change: 1 addition & 0 deletions tests/test_androidtv_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ def setUp(self):
with patchers.PATCH_ADB_DEVICE_TCP, patchers.patch_connect(True)[self.PATCH_KEY], patchers.patch_shell('')[self.PATCH_KEY]:
self.atv = AndroidTVSync('HOST', 5555)
self.atv.adb_connect()
self.assertEqual(self.atv._cmd_get_properties_lazy_no_running_apps, constants.CMD_ANDROIDTV_PROPERTIES_LAZY_NO_RUNNING_APPS)

def test_turn_on_off(self):
"""Test that the ``AndroidTVSync.turn_on`` and ``AndroidTVSync.turn_off`` methods work correctly.
Expand Down
1 change: 1 addition & 0 deletions tests/test_basetv_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ async def setUp(self):
with async_patchers.PATCH_ADB_DEVICE_TCP, async_patchers.patch_connect(True)[self.PATCH_KEY], async_patchers.patch_shell('')[self.PATCH_KEY]:
self.btv = BaseTVAsync('HOST', 5555)
await self.btv.adb_connect()
self.assertEqual(self.btv._cmd_launch_app, "")

def test_available(self):
"""Test that the available property works correctly.
Expand Down
2 changes: 2 additions & 0 deletions tests/test_basetv_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ def setUp(self):
with patchers.PATCH_ADB_DEVICE_TCP, patchers.patch_connect(True)[self.PATCH_KEY], patchers.patch_shell('')[self.PATCH_KEY]:
self.btv = BaseTVSync('HOST', 5555)
self.btv.adb_connect()
self.assertEqual(self.btv._cmd_launch_app, "")

def test_available(self):
"""Test that the available property works correctly.
Expand Down Expand Up @@ -347,6 +348,7 @@ def test_get_device_properties(self):
self.btv.__class__ = AndroidTVSync
device_properties = self.btv.get_device_properties()
self.assertEqual(self.btv.device_properties["manufacturer"], "Google")
self.assertEqual(self.btv._cmd_get_properties_lazy_no_running_apps, constants.CMD_GOOGLE_TV_PROPERTIES_LAZY_NO_RUNNING_APPS)

def test_get_installed_apps(self):
""""Check that `get_installed_apps` works correctly.
Expand Down
1 change: 1 addition & 0 deletions tests/test_firetv_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ async def setUp(self):
with async_patchers.PATCH_ADB_DEVICE_TCP, async_patchers.patch_connect(True)[self.PATCH_KEY], async_patchers.patch_shell('')[self.PATCH_KEY]:
self.ftv = FireTVAsync('HOST', 5555)
await self.ftv.adb_connect()
self.assertEqual(self.ftv._cmd_get_properties_lazy_no_running_apps, constants.CMD_FIRETV_PROPERTIES_LAZY_NO_RUNNING_APPS)

@awaiter
async def test_turn_on_off(self):
Expand Down
1 change: 1 addition & 0 deletions tests/test_firetv_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ def setUp(self):
with patchers.PATCH_ADB_DEVICE_TCP, patchers.patch_connect(True)[self.PATCH_KEY], patchers.patch_shell('')[self.PATCH_KEY]:
self.ftv = FireTVSync('HOST', 5555)
self.ftv.adb_connect()
self.assertEqual(self.ftv._cmd_get_properties_lazy_no_running_apps, constants.CMD_FIRETV_PROPERTIES_LAZY_NO_RUNNING_APPS)

def test_turn_on_off(self):
"""Test that the ``FireTVSync.turn_on`` and ``FireTVSync.turn_off`` methods work correctly.
Expand Down

0 comments on commit 88ada41

Please sign in to comment.