diff --git a/tests/test_installed_apps.py b/tests/test_installed_apps.py index 7f6ae6f..2be5234 100644 --- a/tests/test_installed_apps.py +++ b/tests/test_installed_apps.py @@ -247,6 +247,35 @@ class TestDiscoverySweep: assert isinstance(row["name"], str) and row["name"] assert isinstance(row["icon"], str) and row["icon"] + async def test_the_live_bug_the_discovered_list_is_a_superset(self): + """The complaint in one assertion: every app the user has, plus the + curated four, is offered — not just the curated four.""" + from nsh.const import DEFAULT_APP_DIRECTORY + + poller = _DiscoveryPoller(dumps={"ar.tvplayer.tv": DUMP_TIVIMATE}) + manager = _manager(poller) + + rows = await manager.async_refresh_installed_apps() + packages = {row["package"] for row in rows} + + # the curated list the integration used to fall back to + assert set(DEFAULT_APP_DIRECTORY) <= packages + # ...and the apps it missed, which is what the user reported + for package in ( + "ar.tvplayer.tv", # TiviMate + "com.github.damontecres.wholphin", # Wholphin + "com.netflix.ninja", # Netflix + "com.google.android.youtube.tv", # YouTube + "org.xbmc.kodi", + "com.plexapp.android", + "com.spotify.tv.android", + "com.example.handmade", + ): + assert package in packages, package + assert "com.google.android.tvlauncher" in packages # + the launcher + # a system app the device never lists as -3 is NOT invented here + assert "com.android.systemui" not in packages + async def test_the_sweep_issues_the_documented_commands(self): poller = _DiscoveryPoller(dumps={"ar.tvplayer.tv": DUMP_TIVIMATE}) manager = _manager(poller)