From 7f4e8b394cf3ffbc8aa9e8debb3d1694870e0c6b Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sat, 24 Dec 2022 00:07:03 +0100 Subject: [PATCH] Remove old test about old callback mechanism --- test/actionsmap/moulitest.yml | 15 --------------- test/src/testauth.py | 4 ---- test/test_auth.py | 19 ------------------- 3 files changed, 38 deletions(-) diff --git a/test/actionsmap/moulitest.yml b/test/actionsmap/moulitest.yml index 9802037d..4bb760b9 100644 --- a/test/actionsmap/moulitest.yml +++ b/test/actionsmap/moulitest.yml @@ -7,21 +7,6 @@ _global: authentication: api: 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 # diff --git a/test/src/testauth.py b/test/src/testauth.py index ffd5583d..cbcb3c5b 100644 --- a/test/src/testauth.py +++ b/test/src/testauth.py @@ -44,7 +44,3 @@ def testauth_with_extra_str_only(only_a_str): def testauth_with_type_int(only_an_int): return only_an_int - - -def yoloswag_version(*args, **kwargs): - return "666" diff --git a/test/test_auth.py b/test/test_auth.py index b5537bb7..1f557329 100644 --- a/test/test_auth.py +++ b/test/test_auth.py @@ -255,25 +255,6 @@ class TestAuthCLI: 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): mocker.patch("os.isatty", return_value=True) mocker.patch("prompt_toolkit.prompt", return_value="dummy")