Skip to content

Commit

Permalink
test: add more test case
Browse files Browse the repository at this point in the history
  • Loading branch information
01Joseph-Hwang10 committed Mar 6, 2024
1 parent 6ac052e commit 0a8b64d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/test_dotty_custom_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,5 +123,20 @@ def test_dotty_del_custom_types(dot: Dotty):
assert dot.get("h.name") is None


def test_dotty_views_custom_types(dot: Dotty):
assert list(dot) == ["a", "g", "h"]
assert list(dot.keys()) == ["a", "g", "h"]
assert list(dot.values()) == [
dot["a"],
dot["g"],
dot["h"],
]
assert list(dot.items()) == [
("a", dot["a"]),
("g", dot["g"]),
("h", dot["h"]),
]


def test_dotty_to_dict(dot: Dotty, dot_serialized):
assert dot.to_dict() == dot_serialized

0 comments on commit 0a8b64d

Please sign in to comment.