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
assert result == {"attr1": "foo", "alist": [1, 2, 3], "test_id": "42"}
291291

292292

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

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy