1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
import pweave
import shutil
def test_cache():
"""Test caching shell"""
shutil.rmtree("tests/processors/cache", ignore_errors=True)
pweave.weave("tests/processors/processor_test.pmd", docmode = True)
pweave.weave("tests/processors/processor_test.pmd", docmode = True)
assertSameContent("tests/processors/processor_test.md", "tests/processors/processor_cache_ref.md")
def assertSameContent(REF, outfile):
out = open(outfile)
ref = open(REF)
assert (out.read() == ref.read())
if __name__ == '__main__':
test_cache()
|