Skip to content

Commit

Permalink
test: add test for to_json() method
Browse files Browse the repository at this point in the history
This should get us to 100% test coverage on `gitlab/base.py`
  • Loading branch information
JohnVillalovos committed Oct 23, 2024
1 parent 14d2a82 commit f4bfe19
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/unit/base/test_rest_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,12 @@ def test_attributes_has_parent_attrs(fake_object_with_parent):
assert result == {"attr1": "foo", "alist": [1, 2, 3], "test_id": "42"}


def test_to_json(fake_object):
assert fake_object.attr1 == "foo"
result = fake_object.to_json()
assert result == '{"attr1": "foo", "alist": [1, 2, 3]}'


def test_asdict(fake_object):
assert fake_object.attr1 == "foo"
result = fake_object.asdict()
Expand Down

0 comments on commit f4bfe19

Please sign in to comment.