From 364d4b7da3382bc489972bdaf8b929a03b7c4450 Mon Sep 17 00:00:00 2001 From: James Mackay Date: Mon, 12 Oct 2026 07:40:41 +0100 Subject: [PATCH] test(discovery): pin that the discovered list is a superset MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The live complaint in one assertion: every app the user has, plus the curated four, is offered — TiviMate, Wholphin, Netflix, YouTube, Kodi, Plex, Spotify and an app only this device knows, with the launcher added and no system app invented that `pm list packages -3` never reported. --- tests/test_installed_apps.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) 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)