Commit f4bfe19b authored by John L. Villalovos's avatar John L. Villalovos Committed by John Villalovos
Browse files

test: add test for `to_json()` method

This should get us to 100% test coverage on `gitlab/base.py`
parent 14d2a829
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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()