Example #1
0
 def test_history(self):
     ivc = StringValueCounter('test_counter', history=2)
     ivc.update('qw')
     ivc.update('wq')
     hp, hn = ivc.get_history()
     self.assertEqual(hp[1], 'qw')
     self.assertEqual(hn[1], 'wq')
Example #2
0
 def test_current_value(self):
     ivc = StringValueCounter('test_counter')
     ivc.update('aha')
     self.assertEqual(ivc.get_current(), 'aha')
     ivc.update('abc')
     self.assertEqual(ivc.get_current(), 'abc')
Example #3
0
 def test_enabled(self):
     ivc = StringValueCounter('test_counter')
     ivc.disable()
     ivc.update('aha')
     self.assertRaises(NoData, ivc.get_current)