Esempio n. 1
0
def test_longest_line_length():
    """
    Tests the function count_divisible_digits
    """
    print('Testing longest_line_length')
    assert_equals(13, hw1.longest_line_length('poem.txt'))
    assert_equals(None, hw1.longest_line_length('nothing.txt'))
Esempio n. 2
0
def test_longest_line_length():
    """
    Test the function longest_line_length
    """
    print('Testing longest_line_length')

    assert_equals(13, hw1.longest_line_length('poem.txt'))
    assert_equals(None, hw1.longest_line_length('empty.txt'))
    assert_equals(42, hw1.longest_line_length('poem2.txt'))
Esempio n. 3
0
def test_longest_line_length():
    """
    Tests the function longest_line_length
    """
    print('Testing longest_line_length')

    # Spec test
    assert_equals(13, hw1.longest_line_length('poem.txt'))

    # Edge cases
    assert_equals(None, hw1.longest_line_length('empty.txt'))
    assert_equals(11, hw1.longest_line_length('spaces.txt'))
Esempio n. 4
0
def test_longest_line_length():
    """
    Tests the longest_line_length
    """
    print('Testing longest_line_length')

    # Notice that we have to start the function calls with "hw1." since
    # they live in another file

    # Cases from the made up "spec" for this problem
    assert_equals(13, hw1.longest_line_length('poem.txt'))

    # Additional two cases
    assert_equals(14, hw1.longest_line_length('poem2.txt'))
    assert_equals(34, hw1.longest_line_length('poem3.txt'))
Esempio n. 5
0
def test_longest_line_length():
    assert_equals(35, hw1.longest_line_length('song.txt'))
    # new tests
    assert_equals(None, hw1.longest_line_length('empty.txt'))
    assert_equals(5, hw1.longest_line_length('tie.txt'))