Ejemplo n.º 1
0
 def testSetObjects(self):
     a = {'key': set([1, 2])}
     b = {'key': set([3, 4])}
     expected = {'key': set([1, 2, 3, 4])}
     self.assertEqual(merge_two_objects(a, b), expected)
Ejemplo n.º 2
0
 def testTupleObjects(self):
     a = {'key': (1, 2)}
     b = {'key': (3, 4)}
     expected = {'key': (1, 2, 3, 4)}
     self.assertEqual(merge_two_objects(a, b), expected)
Ejemplo n.º 3
0
 def testListObjects(self):
     a = {'key': [1, 2]}
     b = {'key': [3, 4]}
     expected = {'key': [1, 2, 3, 4]}
     self.assertEqual(merge_two_objects(a, b), expected)
Ejemplo n.º 4
0
 def testFloatObjects(self):
     a = {'key': 1.0}
     b = {'key': 2.0}
     expected = {'key': 3.0}
     self.assertEqual(merge_two_objects(a, b), expected)
Ejemplo n.º 5
0
 def testStringObjects(self):
     a = {'key': 'abc'}
     b = {'key': 'def'}
     expected = {'key': 'abcdef'}
     self.assertEqual(merge_two_objects(a, b), expected)
Ejemplo n.º 6
0
 def testMultiDictionaryObjects(self):
     a = {'key': {'inner_key': 1, 'another_key': 2}}
     b = {'key': {'inner_key': 2, 'another_key': 3}}
     expected = {'key': {'inner_key': 3, 'another_key': 5}}
     self.assertEqual(merge_two_objects(a, b), expected)
Ejemplo n.º 7
0
 def testFloatObjects(self):
     a = {'key': 1.0}
     b = {'key': 2.0}
     expected = {'key': 3.0}
     self.assertEqual(merge_two_objects(a, b), expected)
Ejemplo n.º 8
0
 def testMultiDictionaryObjects(self):
     a = {'key': {'inner_key': 1, 'another_key': 2}}
     b = {'key': {'inner_key': 2, 'another_key': 3}}
     expected = {'key': {'inner_key': 3, 'another_key': 5}}
     self.assertEqual(merge_two_objects(a, b), expected)
Ejemplo n.º 9
0
 def testDifferentTypeObjects(self):
     a = {'key': 1}
     b = {'key': 'abc'}
     expected = {'key': (1, 'abc')}
     self.assertEqual(merge_two_objects(a, b), expected)
Ejemplo n.º 10
0
 def testSetObjects(self):
     a = {'key': set([1, 2])}
     b = {'key': set([3, 4])}
     expected = {'key': set([1, 2, 3, 4])}
     self.assertEqual(merge_two_objects(a, b), expected)
Ejemplo n.º 11
0
 def testDictionaryObjects(self):
     a = {'key': {'inner_key': 1}}
     b = {'key': {'inner_key': 2}}
     expected = {'key': {'inner_key': 3}}
     self.assertEqual(merge_two_objects(a, b), expected)
Ejemplo n.º 12
0
 def testListObjects(self):
     a = {'key': [1, 2]}
     b = {'key': [3, 4]}
     expected = {'key': [1, 2, 3, 4]}
     self.assertEqual(merge_two_objects(a, b), expected)
Ejemplo n.º 13
0
 def testTupleObjects(self):
     a = {'key': (1, 2)}
     b = {'key': (3, 4)}
     expected = {'key': (1, 2, 3, 4)}
     self.assertEqual(merge_two_objects(a, b), expected)
Ejemplo n.º 14
0
 def testStringObjects(self):
     a = {'key': 'abc'}
     b = {'key': 'def'}
     expected = {'key': 'abcdef'}
     self.assertEqual(merge_two_objects(a, b), expected)
Ejemplo n.º 15
0
 def testDictionaryObjects(self):
     a = {'key': {'inner_key': 1}}
     b = {'key': {'inner_key': 2}}
     expected = {'key': {'inner_key': 3}}
     self.assertEqual(merge_two_objects(a, b), expected)
Ejemplo n.º 16
0
 def testEmptyObjects(self):
     a = b = {}
     expected = {}
     self.assertEqual(merge_two_objects(a, b), expected)
Ejemplo n.º 17
0
 def testEmptyObjects(self):
     a = b = {}
     expected = {}
     self.assertEqual(merge_two_objects(a, b), expected)
Ejemplo n.º 18
0
 def testIntObjects(self):
     a = {'key': 1}
     b = {'key': 2}
     expected = {'key': 3}
     self.assertEqual(merge_two_objects(a, b), expected)
Ejemplo n.º 19
0
 def testDifferentTypeObjects(self):
     a = {'key': 1}
     b = {'key': 'abc'}
     expected = {'key': (1, 'abc')}
     self.assertEqual(merge_two_objects(a, b), expected)
Ejemplo n.º 20
0
 def testIntObjects(self):
     a = {'key': 1}
     b = {'key': 2}
     expected = {'key': 3}
     self.assertEqual(merge_two_objects(a, b), expected)