Esempio n. 1
0
    def test_serialization_returns_correct_string(self):
        target_json = '{"average_speed": 85, "color": "red", "gear_box": "auto", "hours_driven": 100, "top_speed": 120}'

        test_car = Car("red", 120, "auto", "85", "100")
        res = test_car.get_json()

        self.assertEqual(
            res, target_json,
            "Target json should look like this: {}".format(target_json))