Add test for list of connected dicts and fix flake

This commit is contained in:
Dmitry Shulyak 2015-12-01 15:03:45 +02:00
parent a3f3653ea1
commit 6b81fba3d2
2 changed files with 14 additions and 1 deletions

View File

@ -276,7 +276,7 @@ def parse_list_input(r_input, args):
c = parse_connection(r_input, arg)
connections.append(c)
else:
add_assignment(assignments, arg)
add_assignment(assignments, r_input, arg)
return connections, assignments

View File

@ -202,6 +202,19 @@ def test_parse_connection_disable_events():
assert correct_connection == connection
def test_parse_list_of_connected_dicts():
inputs = {'list': [
{'key': 'emitter1::key'},
{'key': 'emitter2::key'}]}
connections, assignments = vr.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_setting_location(tmpdir):
# XXX: make helper for it
base_path = os.path.join(