Permalink
Browse files

Bug 757592 - More tests for strictness of "older" and "newer"; r=tell…

…iott
  • Loading branch information...
1 parent 6c9beec commit 4e0aca8cab028fd98185c2902d518a0f5fb36f2e @rfk rfk committed May 22, 2012
Showing with 17 additions and 5 deletions.
  1. +17 −5 syncstorage/tests/functional/test_storage.py
@@ -144,16 +144,28 @@ def test_get_collection(self):
res = res.json["items"]
self.assertEquals(res, ['128'])
+ res = self.app.get(self.root + '/storage/col2?older=%s' % ts)
+ res = res.json["items"]
+ self.assertEquals(res, [])
+
+ res = self.app.get(self.root + '/storage/col2?older=%s' % (ts2 + 1))
+ res = res.json["items"]
+ self.assertEquals(sorted(res), ["128", "129"])
+
# "newer"
# Returns only ids for objects in the collection that have been
# last modified since the date given.
res = self.app.get(self.root + '/storage/col2?newer=%s' % ts)
res = res.json["items"]
- try:
- self.assertEquals(res, ['129'])
- except AssertionError:
- # XXX not sure why this fails sometimes
- pass
+ self.assertEquals(res, ['129'])
+
+ res = self.app.get(self.root + '/storage/col2?newer=%s' % ts2)
+ res = res.json["items"]
+ self.assertEquals(res, [])
+
+ res = self.app.get(self.root + '/storage/col2?newer=%s' % (ts - 1))
+ res = res.json["items"]
+ self.assertEquals(sorted(res), ['128', '129'])
# "full"
# If defined, returns the full BSO, rather than just the id.

0 comments on commit 4e0aca8

Please sign in to comment.