Permalink
Browse files

Add deletion test.

  • Loading branch information...
1 parent 3a1bb9a commit 12e72f696f1332332997282210fa54dcdec83634 @bretthoerner committed Aug 9, 2011
Showing with 11 additions and 1 deletion.
  1. +10 −0 tests/tests.py
  2. +1 −1 timak/timelines.py
View
@@ -49,3 +49,13 @@ def test_max_items(self):
timeline.add(self.key, 4, now)
self.assertEqual(len(timeline.get(self.key)), 3)
+
+ def test_delete(self):
+ timeline = Timeline(connection=self.c1, bucket=self.bucket, max_items=3)
+ now = datetime.utcnow()
+
+ timeline.add(self.key, 1, now)
+ self.assertEqual(len(timeline.get(self.key)), 1)
+
+ timeline.delete(self.key, 1, now)
+ self.assertEqual(len(timeline.get(self.key)), 0)
View
@@ -29,7 +29,7 @@ def _merge_two(self, obj1, obj2):
< obj2[uniq_ident]['modified']):
obj1[uniq_ident] = obj2[uniq_ident]
- return self._dict_to_list(obj1)
+ return obj1 # self._dict_to_list(obj1)
def _list_to_dict(self, l):
if not l: return {}

0 comments on commit 12e72f6

Please sign in to comment.