Example #1
0
def main():
    'SCript entry point'
    vars_ = {}
    for fname in sys.argv[1:]:
        current = load(open(fname).read())
        generate.merge(vars_, current)
    sys.stdout.write(dump(vars_))
Example #2
0
def main():
    'SCript entry point'
    vars_ = {}
    for fname in sys.argv[1:]:
        current = load(open(fname).read())
        generate.merge(vars_, current)
    sys.stdout.write(dump(vars_))
Example #3
0
 def test_merge_lists(self):
     dic1 = {'a': [1, 2]}
     dic2 = {'a': [3, 4]}
     generate.merge(dic1, dic2)
     self.assertEqual(dic1['a'], [1, 2, 3, 4])
Example #4
0
 def test_merge_subdict(self):
     dic1 = {'a': {'b': 2}}
     dic2 = {'a': {'c': 3}}
     generate.merge(dic1, dic2)
     self.assertEqual(dic1['a']["c"], 3)
Example #5
0
 def test_merge_identical(self):
     dic1 = {'a': 1}
     dic2 = {'a': 2}
     generate.merge(dic1, dic2)
     self.assertEqual(dic1['a'], 2)
Example #6
0
 def test_merge(self):
     dic1 = {'a': 1}
     dic2 = {'b': 2}
     generate.merge(dic1, dic2)
     self.assertEqual(dic1['b'], 2)
Example #7
0
 def test_merge_lists(self):
     dic1 = {'a': [1, 2]}
     dic2 = {'a': [3, 4]}
     generate.merge(dic1, dic2)
     self.assertEqual(dic1['a'], [1, 2, 3, 4])
Example #8
0
 def test_merge_subdict(self):
     dic1 = {'a': {'b': 2}}
     dic2 = {'a': {'c': 3}}
     generate.merge(dic1, dic2)
     self.assertEqual(dic1['a']["c"], 3)
Example #9
0
 def test_merge_identical(self):
     dic1 = {'a': 1}
     dic2 = {'a': 2}
     generate.merge(dic1, dic2)
     self.assertEqual(dic1['a'], 2)
Example #10
0
 def test_merge(self):
     dic1 = {'a': 1}
     dic2 = {'b': 2}
     generate.merge(dic1, dic2)
     self.assertEqual(dic1['b'], 2)