def test_step(self):
        ft = FakeTimeProvider(t=100)
        self.assertEqual(ft.time(), 100)
        
        ft.step(1)

        self.assertEqual(ft.time(), 101)
Example #2
0
    def test_step(self):
        ft = FakeTimeProvider(t=100)
        self.assertEqual(ft.time(), 100)

        ft.step(1)

        self.assertEqual(ft.time(), 101)
 def test_faketime_default_value_is_strftime_valid(self):
     ft = FakeTimeProvider()
     
     # Calling this shouldn't raise: ValueError: timestamp out of range for platform time_t
     ft.strftime("%s") 
 def test_strftime_uses_fake_time(self):
     ft = FakeTimeProvider(t=123456789)
     self.assertEqual(ft.strftime("%s"), "123456789")
Example #5
0
    def test_faketime_default_value_is_strftime_valid(self):
        ft = FakeTimeProvider()

        # Calling this shouldn't raise: ValueError: timestamp out of range for platform time_t
        ft.strftime("%s")
Example #6
0
 def test_strftime_uses_fake_time(self):
     ft = FakeTimeProvider(t=123456789)
     self.assertEqual(ft.strftime("%s"), "123456789")