File: test_cache.py

package info (click to toggle)
python-pweave 0.30.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 5,064 kB
  • sloc: python: 30,281; makefile: 167
file content (18 lines) | stat: -rw-r--r-- 553 bytes parent folder | download
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()