Exemplo n.º 1
0
def test_tracebacks_from_file_reverse():
    from tbgrep import tracebacks_from_file

    tracebacks = tracebacks_from_file(get_input_file(), reverse=True)
    eq_(next(tracebacks), ''.join(input_lines[15:18]))
    eq_(next(tracebacks), ''.join(input_lines[9:12]))
    eq_(next(tracebacks), ''.join(input_lines[3:6]))

    assert_raises(StopIteration, next, tracebacks)
Exemplo n.º 2
0
def test_tracebacks_from_file():
    from tbgrep import tracebacks_from_file

    tracebacks = tracebacks_from_file(get_input_file())

    eq_(type(tracebacks), types.GeneratorType)
    eq_(next(tracebacks), ''.join(input_lines[3:6]))
    eq_(next(tracebacks), ''.join(input_lines[9:12]))
    eq_(next(tracebacks), ''.join(input_lines[15:18]))

    assert_raises(StopIteration, next, tracebacks)