diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/test_cli.py | 5 | ||||
-rw-r--r-- | tests/unit/test_exceptions.py | 7 |
2 files changed, 7 insertions, 5 deletions
diff --git a/tests/unit/test_cli.py b/tests/unit/test_cli.py index ef33b5d..769b087 100644 --- a/tests/unit/test_cli.py +++ b/tests/unit/test_cli.py @@ -24,8 +24,7 @@ from contextlib import redirect_stderr # noqa: H302 import pytest -from gitlab import cli -from gitlab.exceptions import GitlabError +from gitlab import cli, exceptions @pytest.mark.parametrize( @@ -71,7 +70,7 @@ def test_cls_to_gitlab_resource(class_name, expected_gitlab_resource): "message,error,expected", [ ("foobar", None, "foobar\n"), - ("foo", GitlabError("bar"), "foo (bar)\n"), + ("foo", exceptions.GitlabError("bar"), f"foo (bar{exceptions._PG_VERSION})\n"), ], ) def test_die(message, error, expected): diff --git a/tests/unit/test_exceptions.py b/tests/unit/test_exceptions.py index 6ef0939..dd1a748 100644 --- a/tests/unit/test_exceptions.py +++ b/tests/unit/test_exceptions.py @@ -6,8 +6,11 @@ from gitlab import exceptions @pytest.mark.parametrize( "kwargs,expected", [ - ({"error_message": "foo"}, "foo"), - ({"error_message": "foo", "response_code": "400"}, "400: foo"), + ({"error_message": "foo"}, f"foo{exceptions._PG_VERSION}"), + ( + {"error_message": "foo", "response_code": "400"}, + f"400: foo{exceptions._PG_VERSION}", + ), ], ) def test_gitlab_error(kwargs, expected): |