File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change 1
1
import sys
2
2
import os
3
3
import glob
4
- import StringIO
5
4
import unittest
6
- import new
7
- import codecs
8
5
9
6
#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" )))
13
11
14
12
import inputstream
15
13
#END RELEASE
@@ -30,9 +28,9 @@ def buildTestSuite():
30
28
for idx ,(data ,encoding ) in enumerate (re .compile (
31
29
"^#data\s*\n (.*?)\n #encoding\s*\n (.*?)\n " ,
32
30
re .DOTALL | re .MULTILINE ).findall (open (filename ).read ())):
33
- def encodingTest (self ):
31
+ def encodingTest (self , data = data , encoding = encoding ):
34
32
stream = inputstream .HTMLInputStream (data ,chardet = False )
35
- assert encoding == stream .charEncoding . lower ( )
33
+ self . assertEquals ( encoding . lower (), stream .charEncoding )
36
34
setattr (Html5EncodingTestCase , 'test_%s_%d' % (test_name , idx + 1 ),
37
35
encodingTest )
38
36
You can’t perform that action at this time.
0 commit comments