Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
2e99e17c
Commit
2e99e17c
authored
Aug 14, 2016
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove OFS.ndiff, only used in ZPT tests.
parent
ced97df9
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
601 deletions
+4
-601
src/OFS/ndiff.py
src/OFS/ndiff.py
+0
-565
src/Products/PageTemplates/tests/util.py
src/Products/PageTemplates/tests/util.py
+4
-36
No files found.
src/OFS/ndiff.py
deleted
100644 → 0
View file @
ced97df9
This diff is collapsed.
Click to expand it.
src/Products/PageTemplates/tests/util.py
View file @
2e99e17c
...
...
@@ -11,18 +11,12 @@
#
##############################################################################
######################################################################
# Utility facilities to aid setting things up.
import
os
import
re
import
string
import
sys
from
ExtensionClass
import
Base
import
Products.PageTemplates.tests
class
Bruce
(
Base
):
__allow_access_to_unprotected_subobjects__
=
1
...
...
@@ -91,36 +85,10 @@ class argv(Base):
return
self
def
nicerange
(
lo
,
hi
):
if
hi
<=
lo
+
1
:
return
str
(
lo
+
1
)
else
:
return
"%d,%d"
%
(
lo
+
1
,
hi
)
def
check_html
(
s1
,
s2
):
s1
=
normalize_html
(
s1
)
s2
=
normalize_html
(
s2
)
if
s1
!=
s2
:
from
OFS.ndiff
import
SequenceMatcher
,
dump
,
IS_LINE_JUNK
a
=
string
.
split
(
s1
,
'
\
n
'
)
b
=
string
.
split
(
s2
,
'
\
n
'
)
def
add_nl
(
s
):
return
s
+
'
\
n
'
a
=
map
(
add_nl
,
a
)
b
=
map
(
add_nl
,
b
)
cruncher
=
SequenceMatcher
(
isjunk
=
IS_LINE_JUNK
,
a
=
a
,
b
=
b
)
for
tag
,
alo
,
ahi
,
blo
,
bhi
in
cruncher
.
get_opcodes
():
if
tag
==
'equal'
:
continue
print
(
nicerange
(
alo
,
ahi
)
+
tag
[
0
]
+
nicerange
(
blo
,
bhi
))
dump
(
'<'
,
a
,
alo
,
ahi
)
if
a
and
b
:
print
(
'---'
)
dump
(
'>'
,
b
,
blo
,
bhi
)
assert
s1
==
s2
,
"HTML Output Changed"
assert
s1
==
s2
def
check_xml
(
s1
,
s2
):
...
...
@@ -142,9 +110,9 @@ def normalize_xml(s):
return s
dir = os.path.dirname(Products.PageTemplates.tests.
__file__)
input_dir = os.path.join(
dir
, 'input')
output_dir = os.path.join(
dir
, 'output')
HERE = os.path.dirname(
__file__)
input_dir = os.path.join(
HERE
, 'input')
output_dir = os.path.join(
HERE
, 'output')
def read_input(filename):
...
...
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