Example #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)
Example #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)
Example #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
Example #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 == ""
Example #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
Example #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 == ""