diff options
Diffstat (limited to 'packages/meshbay-hub/tests/test_android_shell.py')
| -rw-r--r-- | packages/meshbay-hub/tests/test_android_shell.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/packages/meshbay-hub/tests/test_android_shell.py b/packages/meshbay-hub/tests/test_android_shell.py index 2990e9b..cd5a36e 100644 --- a/packages/meshbay-hub/tests/test_android_shell.py +++ b/packages/meshbay-hub/tests/test_android_shell.py @@ -139,16 +139,21 @@ def test_the_shim_offers_desktop_channels_and_native_answers_each(): SRC / "photos" / "PhotoChannels.kt", SRC / "phonesync" / "Destination.kt"): native |= set(re.findall(r'^\s*"([\w:-]+)" ->', _read(path), flags=re.M)) # Contacts and messages share one class, its channels named by a prefix. - docs = set(re.findall(r'^\s*"(\w+)" ->', _read(SRC / "phonesync" / "DocChannels.kt"), flags=re.M)) + docs = set(re.findall(r'^\s*"([\w-]+)" ->', _read(SRC / "phonesync" / "DocChannels.kt"), flags=re.M)) for prefix in re.findall(r'DocChannels\("(\w+)"', _read(SRC / "MainActivity.kt")): native |= {f"{prefix}:{name}" for name in docs} + # The chosen-folder backups too, their prefixes in DriveKind.kt. + drive = set(re.findall(r'^\s*"([\w-]+)" ->', _read(SRC / "drive" / "DriveChannels.kt"), flags=re.M)) + for prefix in re.findall(r'prefix = "(\w+)"', _read(SRC / "drive" / "DriveKind.kt")): + native |= {f"{prefix}:{name}" for name in drive} shim = _shim_channels() assert shim, "no channel found in the shim" # A phone has a push distributor to talk to and a camera roll and an # address book to back up, and a desktop has none of them; those families are the ones the desktop lacks # rather than the ones it shares. phone_only = {c for c in shim if c.startswith(("push:", "photosync:", "phonesync:", "contactsync:", - "messagesync:"))} + "calendarsync:", "messagesync:", "drivesync:", + "wasync:"))} assert any(c.startswith("push:") for c in phone_only), "the push channels are gone" assert any(c.startswith("photosync:") for c in phone_only), "the backup channels are gone" assert shim - phone_only <= preload, f"channels the desktop does not have: {shim - preload}" @@ -267,9 +272,11 @@ def test_only_the_personal_profile_is_backed_up(): assert "Profiles.isPersonal(this)" in activity and "const BACKUP = $backups;" in activity shim = _strip_js_comments(_read(SHIM)) gated = shim.split("...(BACKUP ? {", 1)[1].split("} : {}),", 1)[0] - for name in ("photoSync:", "phoneSync:", "contactSync:"): + for name in ("photoSync:", "phoneSync:", "contactSync:", "calendarSync:", "driveSync:", + "whatsappSync:"): assert name in gated, name for path in [*(SRC / "phonesync").rglob("*.kt"), *(SRC / "photos").rglob("*.kt"), + *(SRC / "drive").rglob("*.kt"), *(APP / "src" / "full").rglob("*.kt")]: assert not re.search(r"\.ENTERPRISE_\w+", _read(path)), path.name |