コード例 #1
0
 def test_merge_two_structs_complex(self):
     self.assertEqual(
         merge_two_structs({'a': {'b': {'c': ['d', 'e', {'f': 'g'}]}}}, {'a': {'b': {'c': ['h', 'i']}}}),
         {'a': {'b': {'c': ['d', 'e', {'f': 'g'}, 'h', 'i']}}})
コード例 #2
0
 def test_merge_two_structs_dicts_samekeys(self):
     self.assertEqual(
         merge_two_structs({'a': '1'}, {'a': '2'}),
         {'a': '2'})
コード例 #3
0
 def test_merge_two_structs_dicts_differentkeys(self):
     self.assertEqual(
         merge_two_structs({'a': '1'}, {'b': '2'}),
         {'a': '1', 'b': '2'})
コード例 #4
0
 def test_merge_two_structs_lists_in_dict(self):
     self.assertEqual(
         merge_two_structs({'a': ['b']}, {'a': ['c']}),
         {'a': ['b', 'c']})
コード例 #5
0
 def test_merge_two_structs_lists(self):
     self.assertEqual(
         merge_two_structs(['1'], ['2']),
         ['1', '2'])
コード例 #6
0
 def test_merge_two_structs_simple(self):
     self.assertEqual(
         merge_two_structs('1', '2'),
         '2')