File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -163,11 +163,11 @@ def fromhex(cls, string):
163163
164164 @no (unicode )
165165 def find (self , sub , * args ):
166- return newbytes ( super (newbytes , self ).find (sub , * args ) )
166+ return super (newbytes , self ).find (sub , * args )
167167
168168 @no (unicode )
169169 def rfind (self , sub , * args ):
170- return newbytes ( super (newbytes , self ).rfind (sub , * args ) )
170+ return super (newbytes , self ).rfind (sub , * args )
171171
172172 @no (unicode , (1 , 2 ))
173173 def replace (self , old , new , * args ):
Original file line number Diff line number Diff line change @@ -168,6 +168,18 @@ def test_bytes_plus_bytes(self):
168168 self .assertEqual (b4 , b'ZYXWABCD' )
169169 self .assertTrue (isinstance (b4 , bytes ))
170170
171+ def test_find_not_found (self ):
172+ self .assertEqual (- 1 , bytes (b'ABCDE' ).find (b':' ))
173+
174+ def test_find_found (self ):
175+ self .assertEqual (2 , bytes (b'AB:CD:E' ).find (b':' ))
176+
177+ def test_rfind_not_found (self ):
178+ self .assertEqual (- 1 , bytes (b'ABCDE' ).find (b':' ))
179+
180+ def test_rfind_found (self ):
181+ self .assertEqual (4 , bytes (b'AB:CD:E' ).find (b':' ))
182+
171183 def test_bytes_join_bytes (self ):
172184 b = bytes (b' * ' )
173185 strings = [b'AB' , b'EFGH' , b'IJKL' ]
You can’t perform that action at this time.
0 commit comments