def test_should_return_red_if_not_received_is_more_than_received(self):
     state = DeliveryState.get_state({
         'deliveries': 10,
         'nonResponse': 6,
         'notReceived': 3,
         'received': 1
     })
     self.assertEqual('map-not-received', state)
 def test_should_return_red_if_received_and_unreceived_is_equal_exist(self):
     state = DeliveryState.get_state({
         'deliveries': 10,
         'nonResponse': 0,
         'notReceived': 5,
         'received': 5,
         'hasIssues': 0,
         'noIssues': 0
     })
     self.assertEqual('map-not-received', state)
 def test_should_return_yellow_when_number_of_deliveries_is_zero(self):
     state = DeliveryState.get_state({
         'deliveries': 0,
         'nonResponse': 0,
         'notReceived': 0,
         'received': 0,
         'hasIssues': 0,
         'noIssues': 0
     })
     self.assertEqual('map-no-response-expected', state)
 def test_should_return_white_if_non_response_below_threshold_and_no_responses_exist(
         self):
     state = DeliveryState.get_state({
         'deliveries': 10,
         'nonResponse': 3,
         'notReceived': 0,
         'received': 0,
         'hasIssues': 0,
         'noIssues': 0
     })
     self.assertEqual('map-no-response-expected', state)
 def test_should_return_orange_if_no_issues_less_or_equal_to_has_issues(
         self):
     state = DeliveryState.get_state({
         'deliveries': 10,
         'nonResponse': 2,
         'notReceived': 0,
         'received': 4,
         'hasIssues': 3,
         'noIssues': 1
     })
     self.assertEqual('map-received-with-issues', state)
 def test_should_return_green_if_more_deliveries_are_in_good_condition(
         self):
     state = DeliveryState.get_state({
         'deliveries': 10,
         'nonResponse': 2,
         'notReceived': 1,
         'received': 6,
         'hasIssues': 1,
         'noIssues': 5
     })
     self.assertEqual('map-received', state)
 def test_should_return_grey_when_non_responce_percentage_is_greater_than_X(
         self):
     state = DeliveryState.get_state({
         'deliveries': 10,
         'nonResponse': 8,
         'notReceived': 0,
         'received': 0,
         'hasIssues': 0,
         'noIssues': 0
     })
     self.assertEqual('map-non-response', state)
 def test_should_return_grey_when_non_responce_percentage_is_greater_than_X(self):
     state = DeliveryState.get_state({'deliveries': 10, 'nonResponse': 8, 'notReceived': 0,
                                      'received': 0, 'hasIssues': 0, 'noIssues': 0})
     self.assertEqual('map-non-response', state)
 def test_should_return_yellow_when_number_of_deliveries_is_zero(self):
     state = DeliveryState.get_state({'deliveries': 0, 'nonResponse': 0, 'notReceived': 0,
                                      'received': 0, 'hasIssues': 0, 'noIssues': 0})
     self.assertEqual('map-no-response-expected', state)
 def test_should_return_red_if_received_and_unreceived_is_equal_exist(self):
     state = DeliveryState.get_state({'deliveries': 10, 'nonResponse': 0, 'notReceived': 5,
                                      'received': 5, 'hasIssues': 0, 'noIssues': 0})
     self.assertEqual('map-not-received', state)
 def test_should_return_white_if_non_response_below_threshold_and_no_responses_exist(self):
     state = DeliveryState.get_state({'deliveries': 10, 'nonResponse': 3, 'notReceived': 0,
                                      'received': 0, 'hasIssues': 0, 'noIssues': 0})
     self.assertEqual('map-no-response-expected', state)
 def test_should_return_orange_if_no_issues_less_or_equal_to_has_issues(self):
     state = DeliveryState.get_state({'deliveries': 10, 'nonResponse': 2, 'notReceived': 0,
                                      'received': 4, 'hasIssues': 3, 'noIssues': 1})
     self.assertEqual('map-received-with-issues', state)
 def test_should_return_green_if_more_deliveries_are_in_good_condition(self):
     state = DeliveryState.get_state({'deliveries': 10, 'nonResponse': 2, 'notReceived': 1,
                                      'received': 6, 'hasIssues': 1, 'noIssues': 5})
     self.assertEqual('map-received', state)
 def test_should_return_red_if_not_received_is_more_than_received(self):
     state = DeliveryState.get_state({'deliveries': 10, 'nonResponse': 6, 'notReceived': 3,
                                      'received': 1})
     self.assertEqual('map-not-received', state)