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
0e87b19f
Commit
0e87b19f
authored
Jun 01, 2001
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some more tests
parent
417c85ef
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
6 deletions
+30
-6
lib/python/Products/PluginIndexes/TextIndex/tests/testSplitter.py
...on/Products/PluginIndexes/TextIndex/tests/testSplitter.py
+30
-6
No files found.
lib/python/Products/PluginIndexes/TextIndex/tests/testSplitter.py
View file @
0e87b19f
...
...
@@ -91,10 +91,7 @@ except ImportError:
sys
.
path
[
0
]
=
'../../'
import
Testing
import
unittest
from
Products.PluginIndexes.PathIndex.PathIndex
import
PathIndex
import
unittest
,
locale
import
Splitter
...
...
@@ -104,8 +101,13 @@ class TestCase( unittest.TestCase ):
"""
def
setUp
(
self
):
"""
"""
self
.
testdata
=
(
(
'The quick brown fox jumps over the lazy dog'
,
[
'the'
,
'quick'
,
'brown'
,
'fox'
,
'jumps'
,
'over'
,
'the'
,
'lazy'
,
'dog'
]),
(
'öfters Österreichische herüber Überfall daß Ärger verärgert'
,
[
'öfters'
,
'österreichische'
,
'herüber'
,
'überfall'
,
'daß'
,
'ärger'
,
'verärgert'
])
)
pass
...
...
@@ -122,7 +124,29 @@ class TestCase( unittest.TestCase ):
assert
len
(
Splitter
.
availableSplitters
)
==
len
(
Splitter
.
splitterNames
)
def
_test
(
self
,
sp_name
,
text
,
splitted
):
splitter
=
Splitter
.
getSplitter
(
sp_name
)
result
=
list
(
splitter
(
text
))
assert
result
==
splitted
,
"%s: %s vs %s"
%
(
sp_name
,
result
,
splitted
)
def
testZopeSplitter
(
self
):
"""test ZopeSplitter"""
for
text
,
splitted
in
self
.
testdata
:
self
.
_test
(
"ZopeSplitter"
,
text
,
splitted
)
def
testISOSplitter
(
self
):
"""test ISOSplitter"""
for
text
,
splitted
in
self
.
testdata
:
self
.
_test
(
"ISO_8859_1_Splitter"
,
text
,
splitted
)
# for loc in ["","ru_RU.KOI8-R"]:
# locale.setlocale(locale.LC_ALL , loc)
...
...
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