Пример #1
0
 def test_add_and_retrieve_messages(self):
     queue = self._make_one()
     queue.add(DummyMessage('one'))
     self.assertEqual(len(queue), 1)
     self.failUnless(queue)
     queue.add(DummyMessage('two'))
     self.assertEqual(len(queue), 2)
     self.assertEqual(queue.pop_next(), 'one')
     self.assertEqual(len(queue), 1)
     self.assertEqual(queue.pop_next(), 'two')
     self.assertEqual(len(queue), 0)
     self.failIf(queue)
Пример #2
0
 def test_add_and_retrieve_messages(self):
     queue = self._make_one()
     queue.add(DummyMessage('one'))
     self.assertEqual(len(queue), 1)
     self.failUnless(queue)
     queue.add(DummyMessage('two'))
     self.assertEqual(len(queue), 2)
     self.assertEqual(queue.pop_next(), 'one')
     self.assertEqual(len(queue), 1)
     self.assertEqual(queue.pop_next(), 'two')
     self.assertEqual(len(queue), 0)
     self.failIf(queue)
Пример #3
0
 def test_is_duplicate_true(self):
     queue = self._make_one()
     message = DummyMessage('one')
     queue.add(message)
     self.failUnless(queue.is_duplicate(message))
Пример #4
0
 def test_is_duplicate_true(self):
     queue = self._make_one()
     message = DummyMessage('one')
     queue.add(message)
     self.failUnless(queue.is_duplicate(message))