Esempio n. 1
0
 def test_extend_eviction_time_limited(self):
     b = Messagebuffer(3000)
     b.extend(range(10000))
     assert len(b) > 3000
     b.evict()
     assert len(b) == 3000
Esempio n. 2
0
 def test_extend_limited(self):
     b = Messagebuffer(10)
     b.extend(list(range(20)))
     self.assert_size_and_first(b, 10, 10)
Esempio n. 3
0
 def test_extend_unlimited(self):
     b = Messagebuffer(None)
     b.extend(list(range(20)))
     self.assert_size_and_first(b, 20, 0)
Esempio n. 4
0
 def test_extend_eviction_time_limited(self):
     b = Messagebuffer(3000)
     b.extend(range(10000))
     assert len(b) > 3000
     b.evict()
     assert len(b) == 3000
Esempio n. 5
0
 def test_extend_unlimited(self):
     b = Messagebuffer(None)
     b.extend(list(range(20)))
     self.assert_size_and_first(b, 20, 0)
Esempio n. 6
0
 def test_extend_limited(self):
     b = Messagebuffer(10)
     b.extend(list(range(20)))
     self.assert_size_and_first(b, 10, 10)
Esempio n. 7
0
 def test_extend_eviction_time_limited(self):
     b = Messagebuffer(3000)
     b.extend(range(10000))
     self.assertGreater(len(b), 3000)
     b.evict()
     self.assertEqual(len(b), 3000)
 def test_extend_eviction_time_limited(self):
     b = Messagebuffer(3000)
     b.extend(range(10000))
     self.assertGreater(len(b), 3000)
     b.evict()
     self.assertEqual(len(b), 3000)