File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import sys
22import os
33import glob
4- import StringIO
54import unittest
6- import new
7- import codecs
85
96#RELEASE remove
10- # XXX Allow us to import the sibling module
11- os .chdir (os .path .split (os .path .abspath (__file__ ))[0 ])
12- sys .path .insert (0 , os .path .abspath (os .path .join (os .pardir , "src" )))
7+ if __name__ == '__main__' :
8+ # XXX Allow us to import the sibling module
9+ os .chdir (os .path .split (os .path .abspath (__file__ ))[0 ])
10+ sys .path .insert (0 , os .path .abspath (os .path .join (os .pardir , "src" )))
1311
1412import inputstream
1513#END RELEASE
@@ -30,9 +28,9 @@ def buildTestSuite():
3028 for idx ,(data ,encoding ) in enumerate (re .compile (
3129 "^#data\s*\n (.*?)\n #encoding\s*\n (.*?)\n " ,
3230 re .DOTALL | re .MULTILINE ).findall (open (filename ).read ())):
33- def encodingTest (self ):
31+ def encodingTest (self , data = data , encoding = encoding ):
3432 stream = inputstream .HTMLInputStream (data ,chardet = False )
35- assert encoding == stream .charEncoding . lower ( )
33+ self . assertEquals ( encoding . lower (), stream .charEncoding )
3634 setattr (Html5EncodingTestCase , 'test_%s_%d' % (test_name , idx + 1 ),
3735 encodingTest )
3836
You can’t perform that action at this time.
0 commit comments