예제 #1
0
def test_consume_3():
    # check something tricky: whitespace at beginning & end of line
    testfile = _make_testfile('sometext.txt', ' a b c ')
    chars, words, lines = wordcount_lib.consume(testfile)

    assert chars == 7  # includes whitespace in char count
    assert words == 3
    assert lines == 1
예제 #2
0
def test_consume_1():
    # do a basic test of the consume function.
    testfile = _make_testfile('sometext.txt', 'a b cc\nddd')
    chars, words, lines = wordcount_lib.consume(testfile)

    assert chars == 10
    assert words == 4
    assert lines == 2
예제 #3
0
def test_consume_2():
    # do another basic test of the consume function.
    testfile = _make_testfile('sometext.txt', 'a\nb\ncc\nddd\ne')
    chars, words, lines = wordcount_lib.consume(testfile)

    assert chars == 12  # includes whitespace in char count
    assert words == 5
    assert lines == 5
def test_consume_3():
    # check something tricky: whitespace at beginning & end of line
    testfile = _make_testfile('sometext.txt', ' a b c ')
    chars, words, lines = wordcount_lib.consume(testfile)

    assert chars == 7                     # includes whitespace in char count
    assert words == 3
    assert lines == 1
def test_consume_2():
    # do another basic test of the consume function.
    testfile = _make_testfile('sometext.txt', 'a\nb\ncc\nddd\ne')
    chars, words, lines = wordcount_lib.consume(testfile)

    assert chars == 12                    # includes whitespace in char count
    assert words == 5
    assert lines == 5
def test_consume_1():
    # do a basic test of the consume function.
    testfile = _make_testfile('sometext.txt', 'a b cc\nddd')
    chars, words, lines = wordcount_lib.consume(testfile)

    assert chars == 10
    assert words == 4
    assert lines == 2
def test_consume_4():
    # duplicate test, to demonstrate how push to Github starts build
    # check something tricky: whitespace at beginning & end of line
    testfile = _make_testfile('sometext.txt', ' a b c ee')
    chars, words, lines = wordcount_lib.consume(testfile)

    assert chars == 9  # includes whitespace in char count
    assert words == 4
    assert lines == 1
def test_consume_4():
    # duplicate test, to demonstrate how push to Github starts build
    # check something tricky: whitespace at beginning & end of line
    testfile = _make_testfile('sometext.txt', ' a b c ee')
    chars, words, lines = wordcount_lib.consume(testfile)

    assert chars == 9                     # includes whitespace in char count
    assert words == 4
    assert lines == 1