File tree Expand file tree Collapse file tree 1 file changed +22
-2
lines changed
Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change 11from unittest import TestCase
22
3- from pytest import deprecated_call
3+ from pytest import deprecated_call , raises
44
5- from w3lib .util import str_to_unicode , to_native_str , unicode_to_str
5+ from w3lib .util import (
6+ str_to_unicode ,
7+ to_bytes ,
8+ to_native_str ,
9+ to_unicode ,
10+ unicode_to_str ,
11+ )
612
713
814class StrToUnicodeTestCase (TestCase ):
@@ -12,13 +18,27 @@ def test_deprecation(self):
1218 str_to_unicode ('' )
1319
1420
21+ class ToBytesTestCase (TestCase ):
22+
23+ def test_type_error (self ):
24+ with raises (TypeError ):
25+ to_bytes (True )
26+
27+
1528class ToNativeStrTestCase (TestCase ):
1629
1730 def test_deprecation (self ):
1831 with deprecated_call ():
1932 to_native_str ('' )
2033
2134
35+ class ToUnicodeTestCase (TestCase ):
36+
37+ def test_type_error (self ):
38+ with raises (TypeError ):
39+ to_unicode (True )
40+
41+
2242class UnicodeToStrTestCase (TestCase ):
2343
2444 def test_deprecation (self ):
You can’t perform that action at this time.
0 commit comments