@@ -207,6 +207,22 @@ def test_rt_wrapper_cache_responds_to_external_credential_changes(rt_environ):
rt2 = config.rt_wrapper(None, testutil.RTClient)
assert rt1 is not rt2
def test_rt_wrapper_has_cache(tmp_path):
with update_environ(XDG_CACHE_DIR=tmp_path):
config = config_mod.Config()
rt = config.rt_wrapper(None, testutil.RTClient)
rt.exists(1)
expected = 'conservancy_beancount/{}@*.sqlite3'.format(RT_FILE_CREDS[1])
assert any(tmp_path.glob(expected))
def test_rt_wrapper_without_cache(tmp_path):
tmp_path.chmod(0)
tmp_path.chmod(0o600)
assert not any(tmp_path.iterdir())
def test_cache_mkdir(tmp_path):
expected = tmp_path / 'TESTcache'