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
ed315987
Commit
ed315987
authored
Aug 01, 2010
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Factor out method that needs the warning hook
parent
2a394113
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
14 deletions
+22
-14
src/Products/ZCatalog/tests/test_catalog.py
src/Products/ZCatalog/tests/test_catalog.py
+22
-14
No files found.
src/Products/ZCatalog/tests/test_catalog.py
View file @
ed315987
...
...
@@ -179,7 +179,6 @@ class TestCatalog(CatalogBase, unittest.TestCase):
nums
[
j
]
=
tmp
def
setUp
(
self
):
self
.
warningshook
=
WarningsHook
()
self
.
_catalog
=
self
.
_makeOne
()
self
.
_catalog
.
lexicon
=
PLexicon
(
'lexicon'
)
col1
=
FieldIndex
(
'col1'
)
...
...
@@ -214,9 +213,6 @@ class TestCatalog(CatalogBase, unittest.TestCase):
self
.
_catalog
.
catalogObject
(
dummy
(
self
.
nums
[
x
]),
repr
(
x
))
self
.
_catalog
=
self
.
_catalog
.
__of__
(
dummy
(
'foo'
))
def
tearDown
(
self
):
self
.
_catalog
=
None
# clear
# updateBrains
# __getitem__
...
...
@@ -300,16 +296,6 @@ class TestCatalog(CatalogBase, unittest.TestCase):
self
.
assertEqual
(
len
(
a
),
self
.
upper
,
'length should be %s, its %s'
%
(
self
.
upper
,
len
(
a
)))
def
testEmptyMappingReturnsAll
(
self
):
self
.
warningshook
.
install
()
try
:
upper
=
self
.
upper
length
=
len
(
self
.
_catalog
({}))
self
.
assertEqual
(
length
,
upper
,
'length should be %s, its %s'
%
(
upper
,
length
))
finally
:
self
.
warningshook
.
uninstall
()
def
testMappingWithEmptyKeysDoesntReturnAll
(
self
):
# Queries with empty keys used to return all, because of a bug in the
# parseIndexRequest function, mistaking a CatalogSearchArgumentsMap
...
...
@@ -449,6 +435,27 @@ class TestRangeSearch(CatalogBase, unittest.TestCase):
"%d vs [%d,%d]"
%
(
r
.
number
,
m
,
n
))
class
TestCatalogReturnAll
(
CatalogBase
,
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
warningshook
=
WarningsHook
()
self
.
warningshook
.
install
()
self
.
_catalog
=
self
.
_makeOne
()
def
testEmptyMappingReturnsAll
(
self
):
col1
=
FieldIndex
(
'col1'
)
self
.
_catalog
.
addIndex
(
'col1'
,
col1
)
for
x
in
range
(
0
,
10
):
self
.
_catalog
.
catalogObject
(
dummy
(
x
),
repr
(
x
))
self
.
assertEqual
(
len
(
self
.
_catalog
),
10
)
length
=
len
(
self
.
_catalog
({}))
self
.
assertEqual
(
length
,
10
)
def
tearDown
(
self
):
CatalogBase
.
tearDown
(
self
)
self
.
warningshook
.
uninstall
()
class
TestCatalogSearchArgumentsMap
(
unittest
.
TestCase
):
def
_makeOne
(
self
,
request
=
None
,
keywords
=
None
):
...
...
@@ -597,6 +604,7 @@ def test_suite():
suite
.
addTest
(
unittest
.
makeSuite
(
TestAddDelIndexes
))
suite
.
addTest
(
unittest
.
makeSuite
(
TestCatalog
))
suite
.
addTest
(
unittest
.
makeSuite
(
TestRangeSearch
))
suite
.
addTest
(
unittest
.
makeSuite
(
TestCatalogReturnAll
))
suite
.
addTest
(
unittest
.
makeSuite
(
TestCatalogSearchArgumentsMap
))
suite
.
addTest
(
unittest
.
makeSuite
(
TestMergeResults
))
return
suite
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