1
0
Fork 0
mirror of https://github.com/YunoHost/moulinette.git synced 2024-09-03 20:06:31 +02:00
moulinette/test/test_cache.py
2019-11-25 17:21:13 +01:00

12 lines
334 B
Python

import os.path
def test_open_cachefile_creates(monkeypatch, tmp_path):
monkeypatch.setenv("MOULINETTE_CACHE_DIR", str(tmp_path))
from moulinette.cache import open_cachefile
handle = open_cachefile("foo.cache", mode="w")
assert handle.mode == "w"
assert handle.name == os.path.join(str(tmp_path), "foo.cache")