def test_should_calculate_cylinder_volume(size, expected_value): tire = Tire(size) assert tire.volume(geometry="cylinder") == pytest.approx(expected_value)
def test_should_detect_correct_unit(size, expected_unit): tire = Tire(size) assert tire.unit == expected_unit
def test_should_set_attributes(size, diameter, width, wheel_diameter): tire = Tire(size) assert tire.diameter == pytest.approx(diameter) assert tire.width == pytest.approx(width) assert tire.wheel_diameter == pytest.approx(wheel_diameter)
def test_should_call_successfully(size): tire = Tire(size) assert isinstance(tire, Tire) assert tire.size == size
def test_should_calculate_aspect_ratio(size, expected_value): tire = Tire(size) assert tire.aspect_ratio == pytest.approx(expected_value)
def test_should_calculate_square_toroid_volume(size, expected_value): tire = Tire(size) assert tire.volume(geometry="square_toroid") == pytest.approx(expected_value)