moulinette/test/test_cache.py

13 lines
334 B
Python
Raw Normal View History

import os.path
2019-08-01 16:54:55 +02:00
def test_open_cachefile_creates(monkeypatch, tmp_path):
2019-11-25 17:21:13 +01:00
monkeypatch.setenv("MOULINETTE_CACHE_DIR", str(tmp_path))
from moulinette.cache import open_cachefile
2019-11-25 17:21:13 +01:00
handle = open_cachefile("foo.cache", mode="w")
2019-11-25 17:21:13 +01:00
assert handle.mode == "w"
assert handle.name == os.path.join(str(tmp_path), "foo.cache")