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"
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"
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'