summaryrefslogtreecommitdiff
path: root/tests/unit/test_exceptions.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/test_exceptions.py')
-rw-r--r--tests/unit/test_exceptions.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/unit/test_exceptions.py b/tests/unit/test_exceptions.py
index 57b394b..6ef0939 100644
--- a/tests/unit/test_exceptions.py
+++ b/tests/unit/test_exceptions.py
@@ -3,6 +3,18 @@ import pytest
from gitlab import exceptions
+@pytest.mark.parametrize(
+ "kwargs,expected",
+ [
+ ({"error_message": "foo"}, "foo"),
+ ({"error_message": "foo", "response_code": "400"}, "400: foo"),
+ ],
+)
+def test_gitlab_error(kwargs, expected):
+ error = exceptions.GitlabError(**kwargs)
+ assert str(error) == expected
+
+
def test_error_raises_from_http_error():
"""Methods decorated with @on_http_error should raise from GitlabHttpError."""