D-Bus testing: failed auto sync session must not restart

Extended the test for "auto sync failed permanently" to also check
that the auto sync manager doesn't retry syncing. Probably
SyncEvolution 1.2.x fails this test (untested, unsure whether it had
code for it).
This commit is contained in:
Patrick Ohly 2012-03-22 17:35:36 +01:00
parent f5b1e08dfa
commit e77d50b7db
1 changed files with 27 additions and 0 deletions

View File

@ -2477,6 +2477,33 @@ class TestSessionAPIsDummy(unittest.TestCase, DBusUtil):
' ]\n'
' int32 -1\n'])
# check that no other session is started at the time of
# the next regular auto sync session
def testDone():
DBusUtil.quit_events.append("test done")
loop.quit()
return False
def any_session_ready(object, ready):
if self.running:
DBusUtil.quit_events.append("session " + object + (ready and " ready" or " done"))
loop.quit()
signal = bus.add_signal_receiver(any_session_ready,
'SessionChanged',
'org.syncevolution.Server',
self.server.bus_name,
None,
byte_arrays=True,
utf8_strings=True)
try:
timeout = glib.timeout_add(15 * 1000, testDone)
loop.run()
finally:
glib.source_remove(timeout)
self.assertEqual(DBusUtil.quit_events, ["session " + self.auto_sync_session_path + " ready",
"session " + self.auto_sync_session_path + " done",
"test done"])
# done as part of post-processing in runTest()
self.runTestDBusCheck = checkDBusLog