def test_next_time_moving(self, time): time.side_effect = [3.14, 3.15, 3.16] s = Sequential() values = [ s.next(), s.next(), s.next(), ] self.assertEqual( values, ['3-140000-0000.json', '3-150000-0000.json', '3-160000-0000.json'])
def test_next_time_stopped(self, time): time.return_value = 3.14 s = Sequential() values = [ s.next(), s.next(), s.next(), ] self.assertEqual( values, ['3-140000-0000.json', '3-140000-0001.json', '3-140000-0002.json'])
def test_next_time_moving(self, time): time.side_effect = [3.14, 3.15, 3.16] s = Sequential() values = [ s.next(), s.next(), s.next(), ] self.assertEqual( values, [ '3-140000-0000.json', '3-150000-0000.json', '3-160000-0000.json' ])
def test_next_time_stopped(self, time): time.return_value = 3.14 s = Sequential() values = [ s.next(), s.next(), s.next(), ] self.assertEqual( values, [ '3-140000-0000.json', '3-140000-0001.json', '3-140000-0002.json' ])
def test_init(self): s = Sequential() self.assertEqual(s.n, 0) self.assertEqual(s.last, 0.0)