add test for list merging with refs and for two nodes
diff --git a/reclass/datatypes/tests/test_parameters.py b/reclass/datatypes/tests/test_parameters.py
index 88fc5e1..a0d34cf 100644
--- a/reclass/datatypes/tests/test_parameters.py
+++ b/reclass/datatypes/tests/test_parameters.py
@@ -455,5 +455,25 @@
self.assertEqual(n1.as_dict(), r1)
self.assertEqual(n2.as_dict(), r2)
+ def test_list_merging_with_refs_for_multiple_nodes(self):
+ p1 = Parameters({ 'alpha': { 'one': [1, 2], 'two': [3, 4] }})
+ p2 = Parameters({ 'beta': { 'three': '${alpha:one}' }})
+ p3 = Parameters({ 'beta': { 'three': '${alpha:two}' }})
+ p4 = Parameters({ 'beta': { 'three': '${alpha:one}' }})
+ n1 = Parameters({ 'name': 'node1'})
+ r1 = {'alpha': {'one': [1, 2], 'two': [3, 4]}, 'beta': {'three': [1, 2]}, 'name': 'node1'}
+ r2 = {'alpha': {'one': [1, 2], 'two': [3, 4]}, 'beta': {'three': [1, 2, 3, 4, 1, 2]}, 'name': 'node2'}
+ n2 = Parameters({'name': 'node2'})
+ n2.merge(p1)
+ n2.merge(p2)
+ n2.merge(p3)
+ n2.merge(p4)
+ n2.interpolate()
+ n1.merge(p1)
+ n1.merge(p2)
+ n1.interpolate()
+ self.assertEqual(n1.as_dict(), r1)
+ self.assertEqual(n2.as_dict(), r2)
+
if __name__ == '__main__':
unittest.main()