solutions

Make Some Cars

Create a class Car and create two instances car1 and car2. Then set three attributes for the instances: color, make, and model. Set whatever value you want for those attributes, but make sure they're different from car1 to car2 (i.e. car1 can't have the same color than car2).

Test Cases

test car1 attributes - Run Test

def test_car1_attributes():
    assert isinstance(car1, Car) is True, 'car1 is not created'
    assert isinstance(car1, object) is True

    assert hasattr(car1, 'color') is True, "car1 doesn't have a color attribute"

    assert hasattr(car1, 'make') is True, "car1 doesn't have a make attribute"

    assert hasattr(car1, 'model') is True, "car1 doesn't have a model attribute"

test attributes are different - Run Test

def test_attributes_are_different():
    assert car1.color != car2.color
    assert car1.make != car2.make
    assert car1.model != car2.model

test car2 attributes - Run Test

def test_car2_attributes():
    assert isinstance(car2, Car) is True, 'car2 is not created'
    assert isinstance(car2, object) is True

    assert hasattr(car2, 'color') is True, "car2 doesn't have a color attribute"

    assert hasattr(car2, 'make') is True, "car2 doesn't have a make attribute"

    assert hasattr(car2, 'model') is True, "car2 doesn't have a model attribute"