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
d9a550b5
Commit
d9a550b5
authored
Feb 25, 2013
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Plain Diff
Issue #1470548: Add test for fragment producing with XMLGenerator.
parents
9f10f56d
a5f13d2a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
Lib/test/test_sax.py
Lib/test/test_sax.py
+15
-0
No files found.
Lib/test/test_sax.py
View file @
d9a550b5
...
...
@@ -493,6 +493,21 @@ class XmlgenTest:
func
(
result
)
self
.
assertFalse
(
result
.
closed
)
def
test_xmlgen_fragment
(
self
):
result
=
self
.
ioclass
()
gen
=
XMLGenerator
(
result
)
# Don't call gen.startDocument()
gen
.
startElement
(
"foo"
,
{
"a"
:
"1.0"
})
gen
.
characters
(
"Hello"
)
gen
.
endElement
(
"foo"
)
gen
.
startElement
(
"bar"
,
{
"b"
:
"2.0"
})
gen
.
endElement
(
"bar"
)
# Don't call gen.endDocument()
self
.
assertEqual
(
result
.
getvalue
(),
self
.
xml
(
'<foo a="1.0">Hello</foo><bar b="2.0"></bar>'
)[
len
(
self
.
xml
(
''
)):])
class
StringXmlgenTest
(
XmlgenTest
,
unittest
.
TestCase
):
ioclass
=
StringIO
...
...
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