test(discovery): pin that the discovered list is a superset
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.
This commit is contained in:
1 parent
95d8d20571
commit
364d4b7da3
1 file changed
+29
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user