def test_map_of_list_should_a_dict_with_the_correct_values_2(self): result = map_list_of_dicts(list_of_dicts_2, 'a') self.assertEqual( { 'aa': [list_of_dicts_2[0], list_of_dicts_2[1]], 'ac': [list_of_dicts_2[2]] }, result)
def test_with_multiple_key_should_be_the_expected_dict_2(self): result = map_list_of_dicts(list_of_dicts_2, 'a', 'b') self.assertEqual( { 'aa': { 'ba': [list_of_dicts_2[0]], 'bb': [list_of_dicts_2[1]] }, 'ac': { 'bc': [list_of_dicts_2[2]] } }, result)
def test_map_of_list_should_a_dict_with_the_3_expected_keys(self): result = map_list_of_dicts(list_of_dicts, 'a') self.assertSetEqual(set(result.keys()), set(('aa', 'ab', 'ac')))
def test_map_of_list_should_return_a_dict(self): result = map_list_of_dicts(list_of_dicts, 'a') self.assertIsInstance(result, dict)