From 4a1b4193addd9d63ce5977e3e9abcbbf90b54fee Mon Sep 17 00:00:00 2001 From: Jean Raby Date: Thu, 15 Mar 2012 14:59:08 +0000 Subject: [PATCH] Compare the sync token with the end time of the query, not the start time. This should stop the test from failing when everything is really ok.. Monotone-Parent: 44e6a1e9a80f2c2e2c230c1d9be4552941343bea Monotone-Revision: 83140ea045c02e9961515cc478033e97df559cfb Monotone-Author: jraby@inverse.ca Monotone-Date: 2012-03-15T14:59:08 --- Tests/Integration/test-webdavsync.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Tests/Integration/test-webdavsync.py b/Tests/Integration/test-webdavsync.py index 0ae9432c1..d6dc34fca 100755 --- a/Tests/Integration/test-webdavsync.py +++ b/Tests/Integration/test-webdavsync.py @@ -2,11 +2,12 @@ from config import hostname, port, username, password +import math import sys import sogotests +import time import unittest import webdavlib -import time resource = '/SOGo/dav/%s/Calendar/test-webdavsync/' % username @@ -51,10 +52,11 @@ class WebdavSyncTest(unittest.TestCase): token = int(token_node.text) self.assertTrue(token > 0) - self.assertTrue(token <= int(query1.start), - "token = %d > query.start = %d" % (token, int(query1.start))) + query1EndTime = int(math.ceil(query1.start + query1.duration)) + self.assertTrue(token <= query1EndTime, + "token = %d > query1EndTime = %d" % (token, query1EndTime)) - # we make sure that any token is acceoted when the collection is + # we make sure that any token is accepted when the collection is # empty, but that the returned token differs query2 = webdavlib.WebDAVSyncQuery(resource, "1234", [ "getetag" ]) self.client.execute(query2)