Open AppleBottomSneed opened 5 months ago
Remember to check the errors the unit tests throw at you and have a thorough look on why it is.
In this case, under test_car_park.py:
def test_car_park_initialized_with_all_attributes(self): self.assertIsInstance(self.car_park, CarPark) self.assertEqual(self.car_park.location, "123 Example Street") self.assertEqual(self.car_park.capacity, 100) self.assertEqual(self.car_park.plates, []) self.assertEqual(self.car_park.sensors, []) self.assertEqual(self.car_park.displays, []) self.assertEqual(self.car_park.available_bays, 100)
I overlooked it and forgot to properly instance the lists as they're mutable and should never be set as the default by itself i.e. plates, sensors and displays. Hope this helps
@AppleBottomSneed - I know it was a while ago, but I am just going through and making fixes - can you recall what the action steps were here?
Remember to check the errors the unit tests throw at you and have a thorough look on why it is.
In this case, under test_car_park.py:
I overlooked it and forgot to properly instance the lists as they're mutable and should never be set as the default by itself i.e. plates, sensors and displays. Hope this helps