Skip to content

Commit b20ca47

Browse files
committed
Added testcases to DictView tests
Signed-off-by: Andreas Maier <andreas.r.maier@gmx.de>
1 parent 21d609d commit b20ca47

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

tests/unittest/test_dict_view.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,20 @@ def __ne__(self, other):
9292
),
9393
None, None, True
9494
),
95+
(
96+
"From DictView of empty dict as positional arg",
97+
dict(
98+
init_args=(DictView({}),),
99+
init_kwargs={},
100+
exp_dict=DictView({}),
101+
verify_order=True,
102+
),
103+
None, None, True
104+
),
95105

96106
# Non-empty original dictionaries
97107
(
98-
"From dict as positional arg",
108+
"From non-empty dict as positional arg",
99109
dict(
100110
init_args=({'Dog': 'Cat', 'Budgie': 'Fish'},),
101111
init_kwargs={},
@@ -104,6 +114,16 @@ def __ne__(self, other):
104114
),
105115
None, None, True
106116
),
117+
(
118+
"From DictView of non-empty dict as positional arg",
119+
dict(
120+
init_args=(DictView({'Dog': 'Cat', 'Budgie': 'Fish'}),),
121+
init_kwargs={},
122+
exp_dict=DictView({'Dog': 'Cat', 'Budgie': 'Fish'}),
123+
verify_order=False,
124+
),
125+
None, None, True
126+
),
107127

108128
# Error cases with inputs that are invalid for the view but would be valid
109129
# for a real dictionary

0 commit comments

Comments
 (0)