def test_objects_map_type(tree, patch): tree.data = 'types' types = Objects.types patch.object(Objects, 'types') patch.object(Objects, 'base_type') c = tree.first_child() c.data = 'map_type' r = types(tree) Objects.base_type.assert_called_with(c.child(0)) Objects.types.assert_called_with(c.child(1)) assert r == { '$OBJECT': 'type', 'type': 'Map', 'values': [Objects.base_type(), Objects.types(c.child(1))] }
def test_objects_map_type(tree, patch): tree.data = "types" types = Objects.types patch.object(Objects, "types") patch.object(Objects, "base_type") c = tree.first_child() c.data = "map_type" r = types(tree) Objects.base_type.assert_called_with(c.child(0)) Objects.types.assert_called_with(c.child(1)) assert r == { "$OBJECT": "type", "type": "Map", "values": [Objects.base_type(), Objects.types(c.child(1))], }