def test_map2text(self): map_id = 'shottsuru' # English self.assertEqual('Piranha Pit', IkaUtils.map2text(map_id, languages='en')) # Japanese self.assertEqual('ショッツル鉱山', IkaUtils.map2text(map_id, languages='ja')) # Fallback to English self.assertEqual('Piranha Pit', IkaUtils.map2text(map_id, languages='??')) # Multiple languages self.assertEqual('ショッツル鉱山', IkaUtils.map2text(map_id, languages=['ja', 'en'])) # Unkonwn unknown_map_id = 'unknown' self.assertEqual('?', IkaUtils.map2text(unknown_map_id)) self.assertEqual('<:=', IkaUtils.map2text(unknown_map_id, unknown='<:='))
def test_map2text(self): map_mock = IkaMatcherMock('kinmedai') # English self.assertEqual('Museum d\'Alfonsino', IkaUtils.map2text(map_mock, languages='en')) # Japanese self.assertEqual('キンメダイ美術館', IkaUtils.map2text(map_mock, languages='ja')) # Fallback to English self.assertEqual('Museum d\'Alfonsino', IkaUtils.map2text(map_mock, languages='??')) # Multiple languages self.assertEqual('キンメダイ美術館', IkaUtils.map2text(map_mock, languages=['ja', 'en'])) # Unkonwn unknown_map_mock = IkaMatcherMock('unknown') self.assertEqual('?', IkaUtils.map2text(unknown_map_mock)) self.assertEqual('<:=', IkaUtils.map2text(unknown_map_mock, unknown='<:='))