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_launch_app_stop_app(self):
"""Test that the ``FireTVSync.launch_app`` and ``FireTVSync.stop_app`` methods work correctly.
"""
with patchers.patch_connect(True)[self.PATCH_KEY], patchers.patch_shell(None)[self.PATCH_KEY]:
self.ftv.launch_app("TEST")
self.assertEqual(getattr(self.ftv._adb, self.ADB_ATTR).shell_cmd, constants.CMD_LAUNCH_APP.format("TEST"))
self.ftv.stop_app("TEST")
self.assertEqual(getattr(self.ftv._adb, self.ADB_ATTR).shell_cmd, "am force-stop TEST")
async def launch_app(self, app):
"""Launch an app.
Parameters
----------
app : str
The ID of the app that will be launched
"""
await self._adb.shell(constants.CMD_LAUNCH_APP.format(app))
def launch_app(self, app):
"""Launch an app.
Parameters
----------
app : str
The ID of the app that will be launched
"""
self._adb.shell(constants.CMD_LAUNCH_APP.format(app))