@@ -84,29 +84,29 @@ class HTMLInputStreamTest(unittest.TestCase):
84
84
85
85
def test_char_ascii (self ):
86
86
stream = HTMLInputStream (b"'" , encoding = 'ascii' )
87
- self .assertEqual (stream .charEncoding [0 ], 'ascii ' )
87
+ self .assertEqual (stream .charEncoding [0 ]. name , 'windows-1252 ' )
88
88
self .assertEqual (stream .char (), "'" )
89
89
90
90
def test_char_utf8 (self ):
91
91
stream = HTMLInputStream ('\u2018 ' .encode ('utf-8' ), encoding = 'utf-8' )
92
- self .assertEqual (stream .charEncoding [0 ], 'utf-8' )
92
+ self .assertEqual (stream .charEncoding [0 ]. name , 'utf-8' )
93
93
self .assertEqual (stream .char (), '\u2018 ' )
94
94
95
95
def test_char_win1252 (self ):
96
96
stream = HTMLInputStream ("\xa9 \xf1 \u2019 " .encode ('windows-1252' ))
97
- self .assertEqual (stream .charEncoding [0 ], 'windows-1252' )
97
+ self .assertEqual (stream .charEncoding [0 ]. name , 'windows-1252' )
98
98
self .assertEqual (stream .char (), "\xa9 " )
99
99
self .assertEqual (stream .char (), "\xf1 " )
100
100
self .assertEqual (stream .char (), "\u2019 " )
101
101
102
102
def test_bom (self ):
103
103
stream = HTMLInputStream (codecs .BOM_UTF8 + b"'" )
104
- self .assertEqual (stream .charEncoding [0 ], 'utf-8' )
104
+ self .assertEqual (stream .charEncoding [0 ]. name , 'utf-8' )
105
105
self .assertEqual (stream .char (), "'" )
106
106
107
107
def test_utf_16 (self ):
108
108
stream = HTMLInputStream ((' ' * 1025 ).encode ('utf-16' ))
109
- self .assertTrue (stream .charEncoding [0 ] in ['utf-16-le ' , 'utf-16-be ' ], stream .charEncoding )
109
+ self .assertTrue (stream .charEncoding [0 ]. name in ['utf-16le ' , 'utf-16be ' ], stream .charEncoding )
110
110
self .assertEqual (len (stream .charsUntil (' ' , True )), 1025 )
111
111
112
112
def test_newlines (self ):
0 commit comments