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
b087d5f4
Commit
b087d5f4
authored
Jun 11, 2002
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- removed empty or meaningless comments
- minor source code cleanup
parent
3bdab66c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
30 deletions
+10
-30
lib/python/Products/PluginIndexes/PathIndex/tests/testPathIndex.py
...n/Products/PluginIndexes/PathIndex/tests/testPathIndex.py
+8
-23
lib/python/Products/PluginIndexes/TopicIndex/tests/testTopicIndex.py
...Products/PluginIndexes/TopicIndex/tests/testTopicIndex.py
+2
-7
No files found.
lib/python/Products/PluginIndexes/PathIndex/tests/testPathIndex.py
View file @
b087d5f4
...
...
@@ -32,13 +32,9 @@ class Dummy:
__repr__
=
__str__
class
TestCase
(
unittest
.
TestCase
):
"""
Test PathIndex objects.
"""
""" Test PathIndex objects """
def
setUp
(
self
):
"""
"""
def
setUp
(
self
):
self
.
_index
=
PathIndex
(
'path'
)
self
.
_values
=
{
1
:
Dummy
(
"/aa/aa/aa/1.html"
),
...
...
@@ -61,27 +57,18 @@ class TestCase( unittest.TestCase ):
18
:
Dummy
(
"/bb/cc/cc/18html"
)
}
def
tearDown
(
self
):
"""
"""
def
_populateIndex
(
self
):
def
_populateIndex
(
self
):
for
k
,
v
in
self
.
_values
.
items
():
self
.
_index
.
index_object
(
k
,
v
)
def
testEmpty
(
self
):
"Test an empty PathIndex."
def
testEmpty
(
self
):
assert
len
(
self
.
_index
)
==
0
assert
self
.
_index
.
getEntryForObject
(
1234
)
is
None
self
.
_index
.
unindex_object
(
1234
)
# nothrow
assert
self
.
_index
.
_apply_index
(
{
"suxpath"
:
"xxx"
}
)
is
None
def
testUnIndex
(
self
):
"Test to UnIndex PathIndex."
def
testUnIndex
(
self
):
self
.
_populateIndex
()
...
...
@@ -92,7 +79,7 @@ class TestCase( unittest.TestCase ):
assert
len
(
self
.
_index
.
_unindex
)
==
0
def
testSimpleTests
(
self
):
def
testSimpleTests
(
self
):
self
.
_populateIndex
()
...
...
@@ -123,8 +110,7 @@ class TestCase( unittest.TestCase ):
lst
=
list
(
res
[
0
].
keys
())
self
.
assertEqual
(
lst
,
results
)
def
testComplexOrTests
(
self
):
def
testComplexOrTests
(
self
):
self
.
_populateIndex
()
...
...
@@ -141,7 +127,7 @@ class TestCase( unittest.TestCase ):
lst
=
list
(
res
[
0
].
keys
())
self
.
assertEqual
(
lst
,
results
)
def
testComplexANDTests
(
self
):
def
testComplexANDTests
(
self
):
self
.
_populateIndex
()
...
...
@@ -158,6 +144,5 @@ class TestCase( unittest.TestCase ):
lst
=
list
(
res
[
0
].
keys
())
self
.
assertEqual
(
lst
,
results
)
def
test_suite
():
return
unittest
.
makeSuite
(
TestCase
)
lib/python/Products/PluginIndexes/TopicIndex/tests/testTopicIndex.py
View file @
b087d5f4
...
...
@@ -67,7 +67,6 @@ class TestTopicIndex(TestBase):
def
testOr
(
self
):
""" test 1 """
self
.
_searchOr
(
'doc1'
,[
1
,
2
])
self
.
_searchOr
([
'doc1'
],[
1
,
2
])
...
...
@@ -77,7 +76,6 @@ class TestTopicIndex(TestBase):
def
testAnd
(
self
):
""" test 1 """
self
.
_searchAnd
(
'doc1'
,[
1
,
2
])
self
.
_searchAnd
([
'doc1'
],[
1
,
2
])
...
...
@@ -107,21 +105,18 @@ class ZCatalogTopicTests(TestBase):
self
.
cat
.
catalog_object
(
Obj
(
'5'
,
'doc3'
))
self
.
cat
.
catalog_object
(
Obj
(
'6'
,
'doc3'
))
def
testOr
(
self
):
""" testing or (catalog)"""
self
.
_searchOr
(
'doc1'
,[
1
,
2
])
self
.
_searchOr
(
'doc2'
,[
3
,
4
])
self
.
_searchOr
([
'doc1'
,
'doc2'
],[
1
,
2
,
3
,
4
])
def
testAnd
(
self
):
""" testing And (catalog)"""
self
.
_searchAnd
(
'doc1'
,[
1
,
2
])
self
.
_searchAnd
(
'doc2'
,[
3
,
4
])
self
.
_searchAnd
([
'doc1'
,
'doc2'
],[])
def
_search
(
self
,
query
,
operator
,
expected
):
res
=
self
.
cat
.
searchResults
({
'topic'
:{
'query'
:
query
,
'operator'
:
operator
}})
...
...
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