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
615217a1
Commit
615217a1
authored
Aug 01, 2010
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More tests for add/del index/column
parent
e6910ec7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
src/Products/ZCatalog/tests/test_zcatalog.py
src/Products/ZCatalog/tests/test_zcatalog.py
+17
-0
No files found.
src/Products/ZCatalog/tests/test_zcatalog.py
View file @
615217a1
...
@@ -143,12 +143,29 @@ class TestZCatalog(unittest.TestCase):
...
@@ -143,12 +143,29 @@ class TestZCatalog(unittest.TestCase):
verifyClass
(
IZCatalog
,
ZCatalog
)
verifyClass
(
IZCatalog
,
ZCatalog
)
def
testAddIndex
(
self
):
self
.
_catalog
.
addIndex
(
'id'
,
'FieldIndex'
)
self
.
assert_
(
'id'
in
self
.
_catalog
.
indexes
())
def
testDelIndex
(
self
):
self
.
assert_
(
'title'
in
self
.
_catalog
.
indexes
())
self
.
_catalog
.
delIndex
(
'title'
)
self
.
assert_
(
'title'
not
in
self
.
_catalog
.
indexes
())
def
testClearIndex
(
self
):
def
testClearIndex
(
self
):
idx
=
self
.
_catalog
.
_catalog
.
getIndex
(
'title'
)
idx
=
self
.
_catalog
.
_catalog
.
getIndex
(
'title'
)
self
.
assertEquals
(
len
(
idx
),
self
.
upper
)
self
.
assertEquals
(
len
(
idx
),
self
.
upper
)
self
.
_catalog
.
clearIndex
(
'title'
)
self
.
_catalog
.
clearIndex
(
'title'
)
self
.
assertEquals
(
len
(
idx
),
0
)
self
.
assertEquals
(
len
(
idx
),
0
)
def
testAddColumn
(
self
):
self
.
_catalog
.
addColumn
(
'num'
,
default_value
=
0
)
self
.
assert_
(
'num'
in
self
.
_catalog
.
schema
())
def
testDelColumn
(
self
):
self
.
_catalog
.
delColumn
(
'title'
)
self
.
assert_
(
'title'
not
in
self
.
_catalog
.
schema
())
def
testGetMetadataForUID
(
self
):
def
testGetMetadataForUID
(
self
):
testNum
=
str
(
self
.
upper
-
3
)
# as good as any..
testNum
=
str
(
self
.
upper
-
3
)
# as good as any..
data
=
self
.
_catalog
.
getMetadataForUID
(
testNum
)
data
=
self
.
_catalog
.
getMetadataForUID
(
testNum
)
...
...
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