def test_parse_list_of_connected_dicts(): inputs = {'list': [ {'key': 'emitter1::key'}, {'key': 'emitter2::key'}]} connections, assignments, _ = cr.parse_inputs(inputs) assert assignments == {} assert connections == [ {'child_input': 'list:key', 'parent_input': 'key', 'parent': 'emitter1', 'events': None}, {'child_input': 'list:key', 'parent_input': 'key', 'parent': 'emitter2', 'events': None}]
def test_parse_simple_list(): _, assigments, _ = cr.parse_inputs({'map': [1, 2, 3]}) assert assigments == {'map': [1, 2, 3]}
def test_parse_list_of_dicts1(): _, assigments, _ = cr.parse_inputs({'map': [{'a': 1, 'b': 3}, {'a': 2, 'b': 4}]}) assert assigments == {'map': [{'a': 1, 'b': 3}, {'a': 2, 'b': 4}]}