mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
Zblgmfhpf remove cache tests :|
This commit is contained in:
parent
8d1025e32b
commit
5631719836
2 changed files with 0 additions and 49 deletions
|
@ -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-api")) == "dummy"
|
||||||
assert parser.auth_method(None, ("GET", "/test-auth/only-cli")) is None
|
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):
|
def test_actions_map_import_error(mocker):
|
||||||
from moulinette.interfaces.api import ActionsMapParser
|
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", "default"]) == "dummy"
|
||||||
assert parser.auth_method(["testauth", "only-api"]) is None
|
assert parser.auth_method(["testauth", "only-api"]) is None
|
||||||
assert parser.auth_method(["testauth", "only-cli"]) == "dummy"
|
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"
|
|
||||||
|
|
|
@ -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")
|
|
Loading…
Reference in a new issue