Example #1
0
 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'])
Example #2
0
 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'])
Example #3
0
 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'
             ])
Example #4
0
 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'
             ])
Example #5
0
    def test_init(self):

        s = Sequential()
        self.assertEqual(s.n, 0)
        self.assertEqual(s.last, 0.0)