コード例 #1
0
def test_descending():
    assert not is_ascending((9, 8, 7, 6, 5)), "Descending items"
コード例 #2
0
def test_iter():
    assert is_ascending(iter([1, 2]))
コード例 #3
0
def test_ascending():
    assert is_ascending([-5, 10, 99, 123456]), "Ascending items"
コード例 #4
0
def test_incorrect_args():
    with pytest.raises(TypeError):
        is_ascending(3)
コード例 #5
0
def test_no_args():
    with pytest.raises(TypeError):
        is_ascending()
コード例 #6
0
def test_empty_list():
    assert is_ascending([]), "Empty list"
コード例 #7
0
def test_equal():
    assert not is_ascending([0, 0, 0, 0]), "Equal items"
コード例 #8
0
def test_mixed():
    assert not is_ascending([4, 5, 6, 7, 3, 7, 9]), "Mixed items"