2014-12-05 23:13:50 -05:00
|
|
|
# coding=utf-8
|
2014-12-05 21:46:44 -05:00
|
|
|
import unittest
|
|
|
|
import sys, os.path
|
|
|
|
|
|
|
|
sys.path.append(os.path.abspath('..'))
|
|
|
|
sys.path.append(os.path.abspath('../lib'))
|
|
|
|
|
|
|
|
import sickbeard
|
2014-12-05 23:13:50 -05:00
|
|
|
from sickbeard import encodingKludge as ek
|
2014-12-05 21:46:44 -05:00
|
|
|
from sickbeard.exceptions import ex
|
|
|
|
|
|
|
|
sickbeard.SYS_ENCODING = 'UTF-8'
|
|
|
|
|
|
|
|
DEBUG = VERBOSE = False
|
|
|
|
|
|
|
|
class EncodingTests(unittest.TestCase):
|
|
|
|
def test_encoding(self):
|
2014-12-12 23:25:44 -05:00
|
|
|
strings = [u'Les Enfants De La Télé']
|
2014-12-05 23:13:50 -05:00
|
|
|
|
|
|
|
for s in strings:
|
|
|
|
try:
|
2014-12-12 23:25:44 -05:00
|
|
|
print 'Encoded: ' + ek.ss(s)
|
2014-12-05 23:13:50 -05:00
|
|
|
except Exception, e:
|
2014-12-12 23:25:44 -05:00
|
|
|
ex(e)
|
2014-12-05 21:46:44 -05:00
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
print "=================="
|
|
|
|
print "STARTING - Encoding TESTS"
|
|
|
|
print "=================="
|
|
|
|
print "######################################################################"
|
|
|
|
suite = unittest.TestLoader().loadTestsFromTestCase(EncodingTests)
|