def test_ImageDict_provides_key_value_pairs(self): d = ImageDict() obj1 = cv2.imread(path.join(_this_path, 'data', 'object.png')) mask1 = cv2.imread(path.join(_this_path, 'data', 'object_mask.png')) obj2 = cv2.imread(path.join(_this_path, 'data', 'different_object.png')) value_1 = 1 value_2 = 2 d[obj1, mask1] = value_1 d[obj2] = value_2 key1_spec = (obj1, mask1) key2_spec = (obj2, None) items_specification = ((key1_spec, value_1), (key2_spec, value_2)) items_by_iteritems = d.iteritems() items_by_items = d.items() self.assertItemsEqual(list(items_by_iteritems), items_specification) self.assertItemsEqual(items_by_items, items_specification)