Remove old test about old callback mechanism

This commit is contained in:
Alexandre Aubin 2022-12-24 00:07:03 +01:00
parent aa06187284
commit 7f4e8b394c
3 changed files with 0 additions and 38 deletions

View file

@ -7,21 +7,6 @@ _global:
authentication: authentication:
api: dummy api: dummy
cli: dummy cli: dummy
arguments:
-v:
full: --version
help: Display Yoloswag versions
action: callback
callback:
method: test.src.testauth.yoloswag_version
return: true
-w:
full: --wersion
help: Not existing function
action: callback
callback:
method: test.src.testauth.not_existing_function
return: true
############################# #############################
# Test Actions # # Test Actions #

View file

@ -44,7 +44,3 @@ def testauth_with_extra_str_only(only_a_str):
def testauth_with_type_int(only_an_int): def testauth_with_type_int(only_an_int):
return only_an_int return only_an_int
def yoloswag_version(*args, **kwargs):
return "666"

View file

@ -255,25 +255,6 @@ class TestAuthCLI:
assert "invalid_password" in str(exception) assert "invalid_password" in str(exception)
def test_request_with_callback(self, moulinette_cli, capsys, mocker):
mocker.patch("os.isatty", return_value=True)
mocker.patch("prompt_toolkit.prompt", return_value="dummy")
moulinette_cli.run(["--version"], output_as="plain")
message = capsys.readouterr()
assert "666" in message.out
moulinette_cli.run(["-v"], output_as="plain")
message = capsys.readouterr()
assert "666" in message.out
with pytest.raises(MoulinetteError):
moulinette_cli.run(["--wersion"], output_as="plain")
message = capsys.readouterr()
assert "cannot get value from callback method" in message.err
def test_request_with_arg(self, moulinette_cli, capsys, mocker): def test_request_with_arg(self, moulinette_cli, capsys, mocker):
mocker.patch("os.isatty", return_value=True) mocker.patch("os.isatty", return_value=True)
mocker.patch("prompt_toolkit.prompt", return_value="dummy") mocker.patch("prompt_toolkit.prompt", return_value="dummy")