|
@ -11,6 +11,8 @@ from patacrep.tools.__main__ import main as tools_main |
|
|
from patacrep.tools.cache.__main__ import main as cache_main |
|
|
from patacrep.tools.cache.__main__ import main as cache_main |
|
|
from patacrep.songbook.__main__ import main as songbook_main |
|
|
from patacrep.songbook.__main__ import main as songbook_main |
|
|
|
|
|
|
|
|
|
|
|
from .. import logging_reduced |
|
|
|
|
|
|
|
|
CACHEDIR = os.path.join(os.path.dirname(__file__), "test_cache_datadir", ".cache") |
|
|
CACHEDIR = os.path.join(os.path.dirname(__file__), "test_cache_datadir", ".cache") |
|
|
|
|
|
|
|
|
class TestCache(unittest.TestCase): |
|
|
class TestCache(unittest.TestCase): |
|
@ -46,10 +48,15 @@ class TestCache(unittest.TestCase): |
|
|
]: |
|
|
]: |
|
|
with self.subTest(main=main, args=args): |
|
|
with self.subTest(main=main, args=args): |
|
|
# First compilation. Ensure that cache exists afterwards |
|
|
# First compilation. Ensure that cache exists afterwards |
|
|
self._system(songbook_main, ["songbook", "--steps", "tex,clean", "test_cache.yaml"]) |
|
|
with logging_reduced('patacrep.build'): |
|
|
|
|
|
self._system( |
|
|
|
|
|
songbook_main, |
|
|
|
|
|
["songbook", "--steps", "tex,clean", "test_cache.yaml"] |
|
|
|
|
|
) |
|
|
self.assertTrue(os.path.exists(CACHEDIR)) |
|
|
self.assertTrue(os.path.exists(CACHEDIR)) |
|
|
|
|
|
|
|
|
# Clean cache |
|
|
# Clean cache |
|
|
|
|
|
with logging_reduced('patatools.cache'): |
|
|
self._system(main, args) |
|
|
self._system(main, args) |
|
|
|
|
|
|
|
|
# Ensure that cache does not exist |
|
|
# Ensure that cache does not exist |
|
@ -64,4 +71,5 @@ class TestCache(unittest.TestCase): |
|
|
]: |
|
|
]: |
|
|
with self.subTest(main=main, args=args): |
|
|
with self.subTest(main=main, args=args): |
|
|
# Clean cache |
|
|
# Clean cache |
|
|
|
|
|
with logging_reduced('patatools.cache'): |
|
|
self._system(main, args) |
|
|
self._system(main, args) |
|
|