Zblgmfhpf remove cache tests :|

This commit is contained in:
Alexandre Aubin 2021-08-27 20:54:56 +02:00
parent 8d1025e32b
commit 5631719836
2 changed files with 0 additions and 49 deletions

View file

@ -244,20 +244,6 @@ def test_actions_map_api():
assert parser.auth_method(None, ("GET", "/test-auth/only-api")) == "dummy"
assert parser.auth_method(None, ("GET", "/test-auth/only-cli")) is None
amap.generate_cache("moulitest")
parser = ActionsMapParser()
amap = ActionsMap(parser)
assert amap.main_namespace == "moulitest"
assert amap.default_authentication == "dummy"
assert ("GET", "/test-auth/default") in amap.parser.routes
assert ("POST", "/test-auth/subcat/post") in amap.parser.routes
assert parser.auth_method(None, ("GET", "/test-auth/default")) == "dummy"
assert parser.auth_method(None, ("GET", "/test-auth/only-api")) == "dummy"
assert parser.auth_method(None, ("GET", "/test-auth/only-cli")) is None
def test_actions_map_import_error(mocker):
from moulinette.interfaces.api import ActionsMapParser
@ -320,26 +306,3 @@ def test_actions_map_cli():
assert parser.auth_method(["testauth", "default"]) == "dummy"
assert parser.auth_method(["testauth", "only-api"]) is None
assert parser.auth_method(["testauth", "only-cli"]) == "dummy"
amap.generate_cache("moulitest")
parser = ActionsMapParser(top_parser=top_parser)
amap = ActionsMap(parser)
assert amap.main_namespace == "moulitest"
assert amap.default_authentication == "dummy"
assert "testauth" in amap.parser._subparsers.choices
assert "none" in amap.parser._subparsers.choices["testauth"]._actions[1].choices
assert "subcat" in amap.parser._subparsers.choices["testauth"]._actions[1].choices
assert (
"default"
in amap.parser._subparsers.choices["testauth"]
._actions[1]
.choices["subcat"]
._actions[1]
.choices
)
assert parser.auth_method(["testauth", "default"]) == "dummy"
assert parser.auth_method(["testauth", "only-api"]) is None
assert parser.auth_method(["testauth", "only-cli"]) == "dummy"

View file

@ -1,12 +0,0 @@
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")