Release v0.1.54: scheduled location sessions and paged voice delivery history

This commit is contained in:
Codex
2026-10-19 07:55:36 +08:00
parent ad2614719b
commit 4dc3e2fb9f
28 changed files with 481 additions and 153 deletions
+15
View File
@@ -95,6 +95,21 @@ class PhoneLocationTests(unittest.TestCase):
self.assertEqual(self.listing(viewer), [])
self.assertEqual(len(app.LOCATIONS.listing(self.aid, user=self.members[self.aid])), 1)
def test_two_explicit_modes_and_changed_consent(self):
source,viewer=self.phone('本人'),self.phone('查看人')
result=self.configure(source,phoneIds=[viewer['sid']],sharingMode='scheduled',sampleIntervalSeconds=3600,intervalSeconds=86400)
self.assertEqual((result['sharingMode'],result['sampleIntervalSeconds'],result['intervalSeconds']),('scheduled',3600,86400))
self.start(source);self.point(source)
self.assertEqual(self.listing(viewer)[0]['sharingMode'],'scheduled')
old=source['receipt']
result=self.configure(source,phoneIds=[viewer['sid']],sharingMode='realtime',sampleIntervalSeconds=3600,intervalSeconds=86400)
self.assertNotEqual(old,result['receipt']);self.assertEqual(self.listing(viewer),[])
self.assertEqual((result['sampleIntervalSeconds'],result['intervalSeconds']),(10,10))
started=self.start(source);self.assertEqual(started['sharingMode'],'realtime')
self.assertEqual(app.LOCATIONS.native(source['token'],dict(action='settings'))['sharingMode'],'realtime')
for bad in ('continuous','',None,True,{},[]):
with self.subTest(mode=bad),self.assertRaises(app.Problem):self.configure(source,phoneIds=[viewer['sid']],sharingMode=bad)
def test_other_family_self_and_invalid_recipients_rejected(self):
source, foreign = self.phone('本人'), self.phone('乙家庭', self.other)
for options in (dict(phoneIds=[foreign['sid']]), dict(phoneIds=[source['sid']]),