Exemple #1
0
def test_should_calculate_cylinder_volume(size, expected_value):
    tire = Tire(size)
    assert tire.volume(geometry="cylinder") == pytest.approx(expected_value)
Exemple #2
0
def test_should_detect_correct_unit(size, expected_unit):
    tire = Tire(size)
    assert tire.unit == expected_unit
Exemple #3
0
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)
Exemple #4
0
def test_should_call_successfully(size):
    tire = Tire(size)
    assert isinstance(tire, Tire)
    assert tire.size == size
Exemple #5
0
def test_should_calculate_aspect_ratio(size, expected_value):
    tire = Tire(size)
    assert tire.aspect_ratio == pytest.approx(expected_value)
Exemple #6
0
def test_should_calculate_square_toroid_volume(size, expected_value):
    tire = Tire(size)
    assert tire.volume(geometry="square_toroid") == pytest.approx(expected_value)