Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
CaosDB Crawler
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
CaosDB Crawler
Commits
3a9ca4f3
Commit
3a9ca4f3
authored
7 months ago
by
Alexander Schlemmer
Browse files
Options
Downloads
Patches
Plain Diff
MAINT: refactored xml tests
parent
a6c1fcaf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!181
Release 0.9.0
,
!174
XML Converter
Pipeline
#54414
failed
7 months ago
Stage: info
Stage: setup
Stage: cert
Stage: style
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
unittests/test_xml_converter.py
+4
-10
4 additions, 10 deletions
unittests/test_xml_converter.py
with
4 additions
and
10 deletions
unittests/test_xml_converter.py
+
4
−
10
View file @
3a9ca4f3
...
...
@@ -256,19 +256,12 @@ def test_namespace_xml(converter_registry):
</root>
"""
conv_tail
=
"""
default_namespace: default
subtree:
Text:
type: XMLTextNode
match: (?P<result>.*)
"""
converter
=
XMLTagConverter
(
yaml
.
safe_load
(
"""
type: XMLTag
match_tag:
"
{default-namespace}root
"
xpath:
"
default:node1/text()
"
"""
+
conv_tail
),
"
TestXMLTagConverter
"
,
converter_registry
)
default_namespace: default
"""
),
"
TestXMLTagConverter
"
,
converter_registry
)
tag
=
XMLTagElement
(
fromstring
(
xml_text
))
m
=
converter
.
match
(
tag
)
...
...
@@ -281,10 +274,11 @@ xpath: "default:node1/text()"
type: XMLTag
match_tag:
"
{default-namespace}root
"
xpath:
"
default:node1
"
default_namespace: default
attribs_as_children: false
text_as_children: true
tags_as_children: false
"""
+
conv_tail
),
"
TestXMLTagConverter
"
,
converter_registry
)
"""
),
"
TestXMLTagConverter
"
,
converter_registry
)
children
=
converter
.
create_children
(
GeneralStore
(),
tag
)
assert
len
(
children
)
==
2
assert
children
[
0
].
name
==
"
{default-namespace}node1[1]/text()
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment