Skip to content

Commit f4bfe19

Browse files
test: add test for to_json() method
This should get us to 100% test coverage on `gitlab/base.py`
1 parent 14d2a82 commit f4bfe19

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

‎tests/unit/base/test_rest_object.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,12 @@ def test_attributes_has_parent_attrs(fake_object_with_parent):
290290
assertresult=={"attr1": "foo", "alist": [1, 2, 3], "test_id": "42"}
291291

292292

293+
deftest_to_json(fake_object):
294+
assertfake_object.attr1=="foo"
295+
result=fake_object.to_json()
296+
assertresult=='{"attr1": "foo", "alist": [1, 2, 3]}'
297+
298+
293299
deftest_asdict(fake_object):
294300
assertfake_object.attr1=="foo"
295301
result=fake_object.asdict()

0 commit comments

Comments
(0)