MCPcopy Create free account
hub / github.com/drgrib/dotmap / test_list_comprehension

Method test_list_comprehension

dotmap/test.py:121–133  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

119 self.assertTrue(len(m.subD), 1)
120
121 def test_list_comprehension(self):
122 parentDict = {
123 'name': 'Father1',
124 'children': [
125 {'name': 'Child1'},
126 {'name': 'Child2'},
127 {'name': 'Child3'},
128 ]
129 }
130 parent = DotMap(parentDict)
131 ordered_names = ['Child1', 'Child2', 'Child3']
132 comp = [x.name for x in parent.children]
133 self.assertEqual(ordered_names, comp)
134
135
136class TestPickle(unittest.TestCase):

Callers

nothing calls this directly

Calls 1

DotMapClass · 0.90

Tested by

no test coverage detected