Exemplo n.º 1
0
 def test_get_name_utf8(self):
     """
     Check whether we can successfully get the UTF-8 encoded torrent name when using a different encoding
     """
     t = TorrentDef()
     t.set_name(b'\xA1\xC0')
     self.assertEqual(t.get_name_utf8(), u'\xa1\xc0')
Exemplo n.º 2
0
 def test_get_name_utf8_unknown(self):
     """
     Test whether we can succesfully get the UTF-8 name
     """
     t = TorrentDef()
     t.set_name(b'\xA1\xC0')
     t.torrent_parameters[b'encoding'] = 'euc_kr'
     self.assertEqual(t.get_name_utf8(), u'\xf7')