Пример #1
0
 def test_met_john_message_more_than_once(self):
     """if test fails could be due to meet_with_john_num_plusone function being changed"""
     c = Car(1)
     c.meet_with_john_num_plusone()
     c.meet_with_john_num_plusone()
     self.assertEqual(c.met_john_message(),
                      "Driver 1 met with John Jamieson 2 times.")
Пример #2
0
 def test_choose_direction_fifty(self):
     c = Car(1)
     self.assertEqual(c.choose_direction(50), 0)
Пример #3
0
 def test_met_john_message(self):
     c = Car(1)
     self.assertEqual(c.met_john_message(),
                      "Driver 1 met with John Jamieson 0 time.")
Пример #4
0
 def test_exit_city_karamu(self):
     c = Car(1)
     self.assertEqual(c.exit_city("Karamu Rd"),
                      "Driver 1 has gone to Napier")
Пример #5
0
 def test_exit_city_omahu(self):
     c = Car(1)
     self.assertEqual(c.exit_city("Omahu Rd"),
                      "Driver 1 has gone to Flaxmere")
Пример #6
0
 def test_exit_circular_list_index_zero(self):
     """either iterates backward or returns the same index as input"""
     c = Car(1)
     array = [1, 2, 3, 4]
     self.assertEqual(c.exit_circular_list(array, 0, 1), 3)
Пример #7
0
 def test_exit_city(self):
     c = Car(1)
     self.assertEqual(c.exit_city(None), None)
Пример #8
0
 def test_circular_list_index_three(self):
     """edge test going from back to front. Returns index not items from array"""
     c = Car(1)
     array = [1, 2, 3, 4]
     self.assertEqual(c.circular_list(array, 3, 1), 0)
Пример #9
0
 def test_choose_direction(self):
     c = Car(1)
     self.assertEqual(c.choose_direction(30), 0)
Пример #10
0
 def test_circular_list(self):
     """edge test going from front to back. Returns index not items from array"""
     c = Car(1)
     array = [1, 2, 3, 4]
     self.assertEqual(c.circular_list(array, 0, 0), 3)
Пример #11
0
 def test_choose_to_leave_city_false(self):
     c = Car(1)
     self.assertEqual(c.choose_to_leave_city(71), False)
Пример #12
0
 def test_choose_to_leave_city(self):
     c = Car(1)
     self.assertEqual(c.choose_to_leave_city(70), True)
Пример #13
0
    def test_road_picker_zero(self):
        c = Car(1)
        roads = [["Murdoch Rd", "Riverslea Rd"], ["Windsor Ave", "Grove Rd"], \
                 ["Fredrick St", "Pakowhai Rd"], ["Maraekakaho Rd", "Wall Rd => Southland Rd => Murdoch Rd"]]

        self.assertEqual(c.road_picker(roads, 1, 0), "Windsor Ave")
Пример #14
0
 def test_choose_direction_fifty_one(self):
     c = Car(1)
     self.assertEqual(c.choose_direction(51), 1)