Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
c7885546
Commit
c7885546
authored
Mar 06, 2007
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Addendum of patch #1669633: additional tests for bytes methods.
parent
2e65f892
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
207 additions
and
168 deletions
+207
-168
Lib/test/string_tests.py
Lib/test/string_tests.py
+176
-168
Lib/test/test_bytes.py
Lib/test/test_bytes.py
+31
-0
No files found.
Lib/test/string_tests.py
View file @
c7885546
This diff is collapsed.
Click to expand it.
Lib/test/test_bytes.py
View file @
c7885546
...
...
@@ -6,6 +6,7 @@ import sys
import
tempfile
import
unittest
import
test.test_support
import
test.string_tests
class
BytesTest
(
unittest
.
TestCase
):
...
...
@@ -612,8 +613,38 @@ class BytesTest(unittest.TestCase):
# are not appropriate for bytes
class
BytesAsStringTest
(
test
.
string_tests
.
BaseTest
):
type2test
=
bytes
def
checkequal
(
self
,
result
,
object
,
methodname
,
*
args
):
object
=
bytes
(
object
)
realresult
=
getattr
(
bytes
,
methodname
)(
object
,
*
args
)
self
.
assertEqual
(
self
.
fixtype
(
result
),
realresult
)
def
checkraises
(
self
,
exc
,
object
,
methodname
,
*
args
):
object
=
bytes
(
object
)
self
.
assertRaises
(
exc
,
getattr
(
bytes
,
methodname
),
object
,
*
args
)
# Currently the bytes containment testing uses a single integer
# value. This may not be the final design, but until then the
# bytes section with in a bytes containment not valid
def
test_contains
(
self
):
pass
def
test_find
(
self
):
pass
def
test_main
():
test
.
test_support
.
run_unittest
(
BytesTest
)
test
.
test_support
.
run_unittest
(
BytesAsStringTest
)
if
__name__
==
"__main__"
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment