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
maint-2.0.2
Jean Raby 2012-03-15 14:59:08 +00:00
parent 70dea77b0a
commit 4a1b4193ad
1 changed files with 6 additions and 4 deletions

View File

@ -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)