Esempio n. 1
0
def test_if_armstrong_is_armstrong():
    assert is_armstrong(153), "Is Armstrong number"
    assert is_armstrong(1), "Is Armstrong number"
Esempio n. 2
0
def test_if_non_armstrong_is_not_armstrong():
    assert not is_armstrong(10), "Is not Armstrong number"
def test_case_with_negative_number():
    assert not is_armstrong(-44)
def test_positive_case1():
    assert is_armstrong(9)
def test_positive_case3():
    assert is_armstrong(407)
def test_negative_case3():
    assert not is_armstrong(400)
def test_negative_case2():
    assert not is_armstrong(11)
def test_positive_case2():
    assert is_armstrong(153)
Esempio n. 9
0
def test_is_armstrong_false(not_armstrong):
    assert is_armstrong(not_armstrong) is False
Esempio n. 10
0
def test_is_armstrong_true(armstrong_numb):
    assert is_armstrong(armstrong_numb) is True
Esempio n. 11
0
def test_is_armstrong(number: int, expected_result: bool):

    actual_result = hw4.is_armstrong(number)

    assert actual_result == expected_result