예제 #1
0
 def test_seconds_to_minutes(self):
     """
         Test if returns 8 minutes and 20 seconds.
     """
     time_left = 500
     returned = seconds_to_minutes(time_left)
     self.assertEqual((8, 20), returned)
예제 #2
0
 def test_pause(self):
     """
         When call the function pause the expected value is running = False
     """
     time_left = 1000
     returned = seconds_to_minutes(time_left)
     self.assertEqual((16, 40), returned)
     self.test_pomodoro.pause()
     self.assertFalse(self.test_pomodoro.running)
예제 #3
0
 def test_start(self):
     """
         When call the function start the expected value is running = True
     """
     time_left = 1500
     returned = seconds_to_minutes(time_left)
     self.assertEqual((25, 0), returned)
     self.assertFalse(self.test_pomodoro.running)
     self.test_pomodoro.start()
     self.assertTrue(self.test_pomodoro.running)
예제 #4
0
 def test_update_not_running(self):
     """
         When update is called with running = False the expected vale
         is work_time
     """
     time_left = 005
     returned = seconds_to_minutes(time_left)
     self.assertEqual((0, 5), returned)
     work_time = 1500
     self.test_pomodoro.running = False
     self.test_pomodoro.update()
     self.assertEqual(self.test_pomodoro.time_left, work_time)
예제 #5
0
 def test_update_running(self):
     """
         When update is called with running = True the expected vale
         is time_left - 1
     """
     time_left = 900
     returned = seconds_to_minutes(time_left)
     self.assertEqual((15, 0), returned)
     self.test_pomodoro.time_left = 12
     self.test_pomodoro.running = True
     self.test_pomodoro.update()
     self.assertEqual(self.test_pomodoro.time_left, 11)
예제 #6
0
    def test_update_running_and_not_time_left(self):
        '''
        When rest timer ends time left starts again with work time
        '''
        time_left = 900
        returned = seconds_to_minutes(time_left)
        self.test_pomodoro.time_left = 0
        self.test_pomodoro.running = True
        self.test_pomodoro.work_time = 500
        self.test_pomodoro.update()

        self.assertEqual((15, 0), returned)
        self.assertEqual(self.test_pomodoro.time_left, 500)