diff options
Diffstat (limited to 'packages/meshbay-hub/tests/test_phone_sync.py')
| -rw-r--r-- | packages/meshbay-hub/tests/test_phone_sync.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/packages/meshbay-hub/tests/test_phone_sync.py b/packages/meshbay-hub/tests/test_phone_sync.py index 1a35614..0798ef0 100644 --- a/packages/meshbay-hub/tests/test_phone_sync.py +++ b/packages/meshbay-hub/tests/test_phone_sync.py @@ -99,6 +99,13 @@ win.meshbay = { contactSync: { return fake.status; }, failed: async (code, text) => { fake.log.push(['failed', code, text]); return true; }, +}, messageSync: { + status: async () => ({ ...fake.status, on: !!fake.messagesOn, dir: 'Backups/bob-messages' }), + plan: async () => ({ item: { token: 'm1', name: 'sms-2026-10-10-0900.xml', + dir: 'Backups/bob-messages/2026', size: 4, count: 300 } }), + sent: async (token, dir, name) => { fake.log.push(['sent', token, dir, name]); return true; }, + completed: async () => { fake.log.push(['completed']); return fake.status; }, + failed: async (code, text) => { fake.log.push(['failed', code, text]); return true; }, } }; """ @@ -177,6 +184,18 @@ await m.runDocSync('contacts', { force: true }); assert len(_of(log, "upload")) == 1 +def test_messages_go_under_the_year_in_their_own_folder(tmp_path): + log = _run(""" +fake.messagesOn = true; +m.startPhoneSync(ctx); +await m.runDocSync('contacts'); +await m.runDocSync('messages'); +""", tmp_path) + assert _of(log, "mkdir")[-2:] == [["Backups/bob-messages"], ["Backups/bob-messages/2026"]] + assert ["upload", "Backups/bob-messages/2026", "sms-2026-10-10-0900.xml", "tr-4"] in log + assert ["sent", "m1", "Backups/bob-messages/2026", "sms-2026-10-10-0900.xml"] in log + + # ── alone in the group, at every run ──────────────────────────────────────── def test_the_group_is_asked_about_at_every_run(tmp_path): |