MCPcopy
hub / github.com/python-attrs/attrs / test_nested_dicts

Method test_nested_dicts

tests/test_funcs.py:94–101  ·  view source on GitHub ↗

Test unstructuring deeply nested dictionaries.

(self, C)

Source from the content-addressed store, hash-verified

92 assert {"x": [[{"x": 1, "y": 2}]], "y": None} == asdict(outer)
93
94 def test_nested_dicts(self, C):
95 """
96 Test unstructuring deeply nested dictionaries.
97 """
98 inner = C(1, 2)
99 outer = C({1: {2: inner}}, None)
100
101 assert {"x": {1: {2: {"x": 1, "y": 2}}}, "y": None} == asdict(outer)
102
103 @given(nested_classes, st.sampled_from(MAPPING_TYPES))
104 def test_recurse_property(self, cls, dict_class):

Callers

nothing calls this directly

Calls 2

asdictFunction · 0.90
CClass · 0.70

Tested by

no test coverage detected