Exemplo n.º 1
0
def test_main_no_update(tmpdir, example):
    _main(
        [example],
        should_update=False,
        rootdir=tmpdir,
    )
    # check for the created tmpdir
    assert tmpdir.join('doc-exec-0').check(dir=1)
Exemplo n.º 2
0
def test_main_no_update(tmpdir, example):
    _main(
        [example],
        should_update=False,
        rootdir=tmpdir,
    )
    # check for the created tmpdir
    assert tmpdir.join('doc-exec-0').check(dir=1)
Exemplo n.º 3
0
def test_parsing_problem(tmpdir):
    simple_fp = tmpdir.join('index.txt')
    simple_fp.write(example_index)
    _main(
        [simple_fp],
        should_update=True,
        rootdir=tmpdir,
    )
    corrected = simple_fp.read()
    assert corrected == example_index
Exemplo n.º 4
0
def test_empty_update(tmpdir):
    simple_fp = tmpdir.join('simple.txt')
    simple_fp.write("")
    _main(
        [simple_fp],
        should_update=True,
        rootdir=tmpdir,
    )
    corrected = simple_fp.read()
    assert corrected == ""
Exemplo n.º 5
0
def test_parsing_problem(tmpdir):
    simple_fp = tmpdir.join('index.txt')
    simple_fp.write(example_index)
    _main(
        [simple_fp],
        should_update=True,
        rootdir=tmpdir,
    )
    corrected = simple_fp.read()
    assert corrected == example_index
Exemplo n.º 6
0
def test_empty_update(tmpdir):
    simple_fp = tmpdir.join('simple.txt')
    simple_fp.write("")
    _main(
        [simple_fp],
        should_update=True,
        rootdir=tmpdir,
    )
    corrected = simple_fp.read()
    assert corrected == ""