示例#1
0
 def test_add_false(self):
     ids = list(range(0, self.descr.max_len))
     last_messages_id = LimitedQueuedHashableObjects(ids, self.descr)
     new_id = self.descr.max_len + 1
     last_messages_id.check(new_id)
     new_ids = ids
     new_ids.pop(0)
     new_ids.append(new_id)
     self.assertListEqual(last_messages_id.raw, new_ids)
示例#2
0
 def test_check_false(self):
     last_messages_id = LimitedQueuedHashableObjects([1, 2, 3], self.descr)
     result = last_messages_id.check(4)
     self.assertFalse(result)
示例#3
0
 def test_add_true(self):
     last_messages_id = LimitedQueuedHashableObjects([1, 2, 3], self.descr)
     last_messages_id.check(4)
     self.assertListEqual(last_messages_id.raw, [1, 2, 3, 4])