def test_country(self):
     game_file = GameFile('Game (19xx)(Publisher).tap')
     game_file.release.country = 'GB'
     game_file.language = 'en'
     self.assertEqual(game_file.getTOSECName(),
                      'Game (19xx)(Publisher).tap')
     game_file.release.country = 'CZ'
     game_file.language = 'cz'
     self.assertEqual(game_file.getTOSECName(),
                      'Game (19xx)(Publisher)(CZ).tap')
     game_file.release.country = 'GB'
     game_file.language = 'es'
     self.assertEqual(game_file.getTOSECName(),
                      'Game (19xx)(Publisher)(GB)(es).tap')
     game_file.release.country = 'RU'
     game_file.language = 'en'
     self.assertEqual(game_file.getTOSECName(),
                      'Game (19xx)(Publisher)(RU)(en).tap')
     game_file.release.country = ''
     game_file.language = 'en'
     self.assertEqual(game_file.getTOSECName(),
                      'Game (19xx)(Publisher).tap')
     game_file = GameFile(
         'Sinclair ZX Spectrum\Games\[TAP]\Mihotabpa (19xx)(-)(ru).tap')
     self.assertEqual(game_file.getTOSECName(),
                      'Mihotabpa (19xx)(-)(ru).tap')
     game_file = GameFile(
         'Sinclair ZX Spectrum\Games\[TAP]\Mihotabpa (19xx)(-)(ru)[tr ru].tap'
     )
     self.assertEqual(game_file.getTOSECName(),
                      'Mihotabpa (19xx)(-)[tr ru].tap')
Ejemplo n.º 2
0
 def fileFromRow(self, row):
     if not row['md5']:
         return None
     file = GameFile()
     if 'wos_name' in row.keys():
         file.wos_name = row['wos_name']
         file.wos_path = row['wos_path']
     if 'tosec_path' in row.keys():
         file.tosec_path = row['tosec_path']
     file.format = row['format']
     file.size = row['size']
     file.content_desc = row['content_desc']
     file.release_date = row['release_date']
     file.is_demo = row['is_demo']
     file.setMachineType(row['file_machine_type'])
     file.part = row['part']
     file.side = row['side']
     file.language = row['file_language']
     file.mod_flags = row['mod_flags']
     file.notes = row['notes']
     file.md5 = row['md5']
     file.crc32 = row['crc32']
     file.sha1 = row['sha1']
     return file