Beispiel #1
0
 def test_three_elements(self):
     ml = MessageLoop()
     ml.items = ["f001", "f002", "f003"]
     self.assertEqual("f001", ml.getnext())
     self.assertEqual("f002", ml.getnext())
     self.assertEqual("f003", ml.getnext())
     self.assertEqual("f001", ml.getnext())
     self.assertEqual("f002", ml.getnext())
     self.assertEqual("f003", ml.getnext())
Beispiel #2
0
 def test_three_elements(self):
     ml = MessageLoop()
     ml.items = ['f001', 'f002', 'f003']
     self.assertEqual('f001', ml.getnext())
     self.assertEqual('f002', ml.getnext())
     self.assertEqual('f003', ml.getnext())
     self.assertEqual('f001', ml.getnext())
     self.assertEqual('f002', ml.getnext())
     self.assertEqual('f003', ml.getnext())
Beispiel #3
0
 def test_remove(self):
     ml = MessageLoop()
     ml.items = ['f00', 'bar']
     self.assertEqual("f00", ml.getitem(0))
     ml.remove(0)
     self.assertEqual(['bar'], ml.items)
     self.assertEqual("bar", ml.getitem(0))
Beispiel #4
0
 def test_remove(self):
     ml = MessageLoop()
     ml.items = ['f00', 'bar']
     self.assertEqual("f00", ml.getitem(0))
     ml.remove(0)
     self.assertEqual(['bar'], ml.items)
     self.assertEqual("bar", ml.getitem(0))
Beispiel #5
0
 def test_remove(self):
     ml = MessageLoop()
     ml.items = ["f00", "bar"]
     self.assertEqual("f00", ml.getitem(0))
     ml.remove(0)
     self.assertEqual(["bar"], ml.items)
     self.assertEqual("bar", ml.getitem(0))
Beispiel #6
0
 def test_three_elements(self):
     ml = MessageLoop()
     ml.items = ['f001', 'f002', 'f003']
     self.assertEqual('f001', ml.getnext())
     self.assertEqual('f002', ml.getnext())
     self.assertEqual('f003', ml.getnext())
     self.assertEqual('f001', ml.getnext())
     self.assertEqual('f002', ml.getnext())
     self.assertEqual('f003', ml.getnext())
Beispiel #7
0
 def test_getitem(self):
     ml = MessageLoop()
     ml.items = ["f00"]
     self.assertEqual("f00", ml.getitem(0))
     self.assertEqual(None, ml.getitem(1))
Beispiel #8
0
 def test_put(self):
     ml = MessageLoop()
     self.assertEqual([], ml.items)
     ml.put("bar")
     self.assertEqual(["bar"], ml.items)
Beispiel #9
0
 def test_one_element(self):
     ml = MessageLoop()
     ml.items = ["f00"]
     self.assertEqual("f00", ml.getnext())
     self.assertEqual("f00", ml.getnext())
Beispiel #10
0
 def test_empty(self):
     ml = MessageLoop()
     self.assertEqual([], ml.items)
     self.assertEqual(None, ml.getnext())
Beispiel #11
0
 def test_clear(self):
     ml = MessageLoop()
     ml.items = ['f00', 'bar']
     ml.clear()
     self.assertEqual([], ml.items)
Beispiel #12
0
 def test_getitem(self):
     ml = MessageLoop()
     ml.items = ['f00']
     self.assertEqual("f00", ml.getitem(0))
     self.assertEqual(None, ml.getitem(1))
Beispiel #13
0
 def test_put(self):
     ml = MessageLoop()
     self.assertEqual([], ml.items)
     ml.put("bar")
     self.assertEqual(["bar"], ml.items)
Beispiel #14
0
 def test_one_element(self):
     ml = MessageLoop()
     ml.items = ['f00']
     self.assertEqual('f00', ml.getnext())
     self.assertEqual('f00', ml.getnext())
Beispiel #15
0
 def test_empty(self):
     ml = MessageLoop()
     self.assertEqual([], ml.items)
     self.assertEqual(None, ml.getnext())
Beispiel #16
0
 def test_clear(self):
     ml = MessageLoop()
     ml.items = ['f00', 'bar']
     ml.clear()
     self.assertEqual([], ml.items)
Beispiel #17
0
 def test_clear(self):
     ml = MessageLoop()
     ml.items = ["f00", "bar"]
     ml.clear()
     self.assertEqual([], ml.items)
Beispiel #18
0
 def test_one_element(self):
     ml = MessageLoop()
     ml.items = ['f00']
     self.assertEqual('f00', ml.getnext())
     self.assertEqual('f00', ml.getnext())