summaryrefslogtreecommitdiff
path: root/tests/unit/test_base.py
diff options
context:
space:
mode:
authorNejc Habjan <hab.nejc@gmail.com>2021-06-10 23:50:23 +0200
committerGitHub <noreply@github.com>2021-06-10 23:50:23 +0200
commit600a2c174f5fe274728b98b38d49f009946bcc4f (patch)
treede9bc431060437fe259115c920c67389a0cccb5f /tests/unit/test_base.py
parent161bb0bf1684374ed01c4e3bc8ebc2f5afe7546b (diff)
parentc7bcc25a361f9df440f9c972672e5eec3b057625 (diff)
downloadgitlab-600a2c174f5fe274728b98b38d49f009946bcc4f.tar.gz
Merge pull request #1487 from JohnVillalovos/jlvillal/check_attrs
fix: catch invalid type used to initialize RESTObject
Diffstat (limited to 'tests/unit/test_base.py')
-rw-r--r--tests/unit/test_base.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/unit/test_base.py b/tests/unit/test_base.py
index b3a58fc..8872dbd 100644
--- a/tests/unit/test_base.py
+++ b/tests/unit/test_base.py
@@ -19,6 +19,7 @@ import pickle
import pytest
+import gitlab
from gitlab import base
@@ -85,6 +86,10 @@ class TestRESTObject:
assert fake_manager == obj.manager
assert fake_gitlab == obj.manager.gitlab
+ def test_instantiate_non_dict(self, fake_gitlab, fake_manager):
+ with pytest.raises(gitlab.exceptions.GitlabParsingError):
+ FakeObject(fake_manager, ["a", "list", "fails"])
+
def test_picklability(self, fake_manager):
obj = FakeObject(fake_manager, {"foo": "bar"})
original_obj_module = obj._module