Esempio n. 1
0
 def test_can_personalize_separator(self):
     sep = '+'
     q = SendQueue(separator=sep)
     value = '1+2+3'
     for i in value.split('+'):
         q.push(i)
     self.assertEquals(q.get(), value)
Esempio n. 2
0
    def test_two_values_use_separator(self):
        q = SendQueue()
        one = 'one'
        two = 'two'
        q.push(one)
        q.push(two)

        self.assertEquals(q.get(), '%s%s%s' % (one, q.SEPARATOR, two))
Esempio n. 3
0
 def test_is_empty(self):
     q = SendQueue()
     self.assertTrue(q.is_empty())
     q.push('x')
     self.assertFalse(q.is_empty())
     q.clear()
     self.assertTrue(q.is_empty())
Esempio n. 4
0
 def test_can_clear_non_empty_queue(self):
     q = SendQueue()
     q.push('x')
     q.clear()
     self.assertTrue(q._queue == [])
Esempio n. 5
0
 def test_can_clear_empty_queue(self):
     q = SendQueue()
     q.clear()
Esempio n. 6
0
 def test_single_value_doesnt_use_separator(self):
     q = SendQueue()
     q.push('xxx')
     self.assertFalse(q.SEPARATOR in q.get())