def testGetCC(self): index = country_code_converter.create_index(table) row = country_code_converter.get_cc('name_english', 'Austria', index=index) rowdict = dict([(country_code_converter.columns[i], val) for (i, val) in enumerate(table[0])]) self.assertEqual(rowdict, row) col = country_code_converter.get_cc('name_english', 'Austria', 'car', index=index) self.assertEqual(table[0][5], col)
def testIndexCreation(self): index = country_code_converter.create_index(table) self.assertEqual(index['name_english']['Austria'][2], table[0][2])