Esempio n. 1
0
 def test_merge_list_union_and_override(self):
     template = [{"id": "test1", "a": "a"}]
     config = [{
         "id": "test1",
         "a": "0",
         "b": "b"
     }, {
         "id": "test2",
         "c": "c"
     }]
     result = merge_list(template, config)
     self.assertEqual(result, [{
         "id": "test1",
         "a": "0",
         "b": "b"
     }, {
         "id": "test2",
         "c": "c"
     }])
Esempio n. 2
0
 def test_merge_list_config_value(self):
     template = [{"config_value": "test1", "tx": 1}]
     config = [{"config_value": "test1", "tx": 2}]
     result = merge_list(template, config)
     self.assertEqual(result, config)
Esempio n. 3
0
 def test_merge_list_override(self):
     template = [{"name": "test1", "tx": 1}]
     config = [{"name": "test1", "tx": 2}]
     result = merge_list(template, config)
     self.assertEqual(result, config)