Esempio n. 1
0
 def test_chardet(self):
     data = open(
         os.path.join(test_dir, "encoding", "chardet",
                      "test_big5.txt")).read()
     encoding = inputstream.HTMLInputStream(data).charEncoding
     assert encoding[0].lower() == "big5"
Esempio n. 2
0
 def test_chardet():
     with open(
             os.path.join(test_dir, "encoding", "chardet", "test_big5.txt"),
             "rb") as fp:
         encoding = inputstream.HTMLInputStream(fp.read()).charEncoding
         assert encoding[0].lower() == "big5"
Esempio n. 3
0
 def test_chardet():
     with open(os.path.join(test_dir, 'encoding' , 'chardet', 'test_big5.txt'), 'rb') as fp:
         encoding = inputstream.HTMLInputStream(fp.read()).charEncoding
         assert encoding[0].lower() == 'big5'