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
a2b3ae8d
Commit
a2b3ae8d
authored
Nov 12, 2004
by
Just van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testing control chars and non-dict root objects
parent
6eedddf9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
Lib/test/test_plistlib.py
Lib/test/test_plistlib.py
+16
-0
No files found.
Lib/test/test_plistlib.py
View file @
a2b3ae8d
...
...
@@ -164,6 +164,22 @@ class TestPlistlib(unittest.TestCase):
pl2
=
plistlib
.
readPlist
(
StringIO
(
f
.
getvalue
()))
self
.
assertEqual
(
dict
(
pl
),
dict
(
pl2
))
def
test_controlcharacters
(
self
):
# chars in the range 0..31 are replaced by '?', except for
# \r, \n and \t since they aren't legal XML characters
testString
=
""
.
join
([
chr
(
i
)
for
i
in
range
(
32
)])
expectedResult
=
'?????????
\
t
\
n
??
\
n
??????????????????'
xml
=
plistlib
.
writePlistToString
(
testString
)
result
=
plistlib
.
readPlistFromString
(
xml
)
self
.
assertEqual
(
result
,
expectedResult
)
def
test_nondictroot
(
self
):
test1
=
"abc"
test2
=
[
1
,
2
,
3
,
"abc"
]
result1
=
plistlib
.
readPlistFromString
(
plistlib
.
writePlistToString
(
test1
))
result2
=
plistlib
.
readPlistFromString
(
plistlib
.
writePlistToString
(
test2
))
self
.
assertEqual
(
test1
,
result1
)
self
.
assertEqual
(
test2
,
result2
)
def
test_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