Exemple #1
0
def test_perfnum_1():
    n = 28
    ret_val = perfect_num(n)
    assert ret_val == True
Exemple #2
0
def test_other_perfnum():
    n = [1, 2, 3]
    with pytest.raises(TypeError) as err:
        perfect_num(n)
        assert err.value.args[0] == "unsupported format"
Exemple #3
0
def test_not_perfnum_2():
    n = 1
    ret_val = perfect_num(n)
    assert ret_val == False
Exemple #4
0
def test_bool_perfnum():
    n = True
    with pytest.raises(TypeError) as err:
        perfect_num(n)
        assert err.value.args[0] == "unsupported format"
Exemple #5
0
def test_perfnum_2():
    n = 6, 28, 496
    for i in n:
        ret_val = perfect_num(i)
        assert ret_val == True