Exemplo n.º 1
0
def test_bmi_zero_height():
    with pytest.raises(ZeroDivisionError):
        assert calculate_bmi(0, 150)
Exemplo n.º 2
0
def test_bmi_nonfloat():
    with pytest.raises(ValueError):
        assert calculate_bmi("asdf", 150)
Exemplo n.º 3
0
def test_bmi_underweight():
    assert calculate_bmi(67, 110) == ['17.6', "Underweight"
                                      ], "Should be 17.6 and Underweight"
Exemplo n.º 4
0
def test_bmi_obese():
    assert calculate_bmi(60, 150) == ['30.0',
                                      "Obese"], "Should be 30.0 and Obese"
Exemplo n.º 5
0
def test_bmi_overweight():
    assert calculate_bmi(63, 150) == ['27.2', "Overweight"
                                      ], "Should be 27.2 and Overweight"
Exemplo n.º 6
0
def test_bmi_normal():
    assert calculate_bmi(63, 125) == ['22.7', "Normal weight"
                                      ], "Should be 22.7 and Normal weight"
Exemplo n.º 7
0
def test_bmi__return_list():
    assert type(calculate_bmi(63, 125)) is list