Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5diff
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
erp5diff
Commits
17a51e44
Commit
17a51e44
authored
Aug 05, 2011
by
Nicolas Delaby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tail text nodes was not detected (...<node/>blablabla...)
parent
f6a1fbf0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
6 deletions
+21
-6
src/ERP5Diff/ERP5Diff.py
src/ERP5Diff/ERP5Diff.py
+1
-6
src/tests/erp5diff_test_suite.py
src/tests/erp5diff_test_suite.py
+20
-0
No files found.
src/ERP5Diff/ERP5Diff.py
View file @
17a51e44
...
@@ -414,12 +414,7 @@ class ERP5Diff:
...
@@ -414,12 +414,7 @@ class ERP5Diff:
</node>")
</node>")
tree.node.text == '
\
n
'
tree.node.text == '
\
n
'
"""
"""
for
child
in
element
:
return
not
[
text
for
text
in
element
.
xpath
(
'text()'
)
if
text
.
strip
()]
if
type
(
child
)
==
etree
.
_Element
:
return
True
if
element
.
text
is
None
:
return
True
return
bool
(
element
.
text
.
strip
())
is
False
or
False
def
_makeRelativePathList
(
self
,
element_list
,
before
=
0
):
def
_makeRelativePathList
(
self
,
element_list
,
before
=
0
):
"""
"""
...
...
src/tests/erp5diff_test_suite.py
View file @
17a51e44
...
@@ -1111,5 +1111,25 @@ class TestERP5Diff(unittest.TestCase):
...
@@ -1111,5 +1111,25 @@ class TestERP5Diff(unittest.TestCase):
self
.
_assertERP5DiffWorks
(
old_xml
,
new_xml
,
expected_result_string
)
self
.
_assertERP5DiffWorks
(
old_xml
,
new_xml
,
expected_result_string
)
def
test_text_node_in_tails
(
self
):
"""31. Check tail of elements ...<node/>blablabla...
"""
old_xml
=
"""
<ul>
<node/>blablabla
</ul>
"""
new_xml
=
"""
<ul>
<node/>yayaya
</ul>
"""
expected_result_string
=
"""<xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
<xupdate:update select="/ul"><node/>yayaya
</xupdate:update>
</xupdate:modifications>
"""
self
.
_assertERP5DiffWorks
(
old_xml
,
new_xml
,
expected_result_string
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
unittest
.
main
()
unittest
.
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