Ejemplo n.º 1
0
 def test_alert_meet_min_hours_doesnt_meet(
     self, mock_alert
 ):  # Need self because it is a method in a class and variable for our mock
     timesheets.alert_not_meet_min_hours(
         12,
         30)  # if 12 is smaller than 30 then we expect an alery to happen
     mock_alert.assert_called_once()
Ejemplo n.º 2
0
 def test_alert_meet_min_hours_exceed(self, mock_alert):
     timesheets.alert_not_meet_min_hours(45, 30)
     mock_alert.assert_not_called()
Ejemplo n.º 3
0
 def test_alert_meet_min_hours_doesnt_meet(self, mock_alert):
     timesheets.alert_not_meet_min_hours(12, 30)
     mock_alert.assert_called_once()
Ejemplo n.º 4
0
 def test_alert_meet_min_hours_does_meet_min(self, mock_alert):
     timesheets.alert_not_meet_min_hours(40, 30)
     mock_alert.assert_not_called(
     )  # we want to assert that the alert is not called
Ejemplo n.º 5
0
 def test_alert_meet_min_hours_doesnt_meet(self, mock_print, mock_alert):
     timesheets.alert_not_meet_min_hours(10, 30)
     mock_alert.assert_called_once()
     mock_print.assert_called_once_with(
         'You worked less than the minimum number of hours')
Ejemplo n.º 6
0
 def test_alert_meet_min_hours_does_meet_min(self, mock_alert):
     timesheets.alert_not_meet_min_hours(40, 30)
     mock_alert.assert_not_called()