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
a9e41899
Commit
a9e41899
authored
Aug 05, 2010
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More trivial tests
parent
5107666a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
2 deletions
+34
-2
src/Products/ZCatalog/plan.py
src/Products/ZCatalog/plan.py
+2
-1
src/Products/ZCatalog/tests/test_plan.py
src/Products/ZCatalog/tests/test_plan.py
+32
-1
No files found.
src/Products/ZCatalog/plan.py
View file @
a9e41899
...
...
@@ -138,6 +138,7 @@ class ValueIndexes(object):
@
classmethod
def
set
(
cls
,
value
):
value
=
frozenset
(
value
)
with
cls
.
lock
:
cls
.
value
=
value
...
...
@@ -172,7 +173,7 @@ class ValueIndexes(object):
# greater than zero
value_indexes
.
add
(
name
)
cls
.
set
(
frozenset
(
value_indexes
)
)
cls
.
set
(
value_indexes
)
return
value_indexes
...
...
src/Products/ZCatalog/tests/test_plan.py
View file @
a9e41899
...
...
@@ -155,7 +155,38 @@ class TestReports(unittest.TestCase):
self
.
assertEquals
(
type
(
self
.
reports
.
lock
),
LockType
)
# class TestValueIndexes(unittest.TestCase):
class
TestValueIndexes
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
value
=
self
.
_makeOne
()
def
tearDown
(
self
):
self
.
value
.
clear
()
def
_makeOne
(
self
):
from
..plan
import
ValueIndexes
return
ValueIndexes
def
test_get
(
self
):
self
.
assertEquals
(
self
.
value
.
get
(),
frozenset
())
def
test_set
(
self
):
indexes
=
(
'index1'
,
'index2'
)
self
.
value
.
set
(
indexes
)
self
.
assertEquals
(
self
.
value
.
get
(),
frozenset
(
indexes
))
def
test_clear
(
self
):
self
.
value
.
set
((
'index1'
,
))
self
.
value
.
clear
()
self
.
assertEquals
(
self
.
value
.
get
(),
frozenset
())
def
test_determine_already_set
(
self
):
self
.
value
.
set
((
'index1'
,
))
self
.
assertEquals
(
self
.
value
.
determine
(()),
frozenset
((
'index1'
,
)))
# class TestValueIndexesDetermination(unittest.TestCase):
# Test the actual logic for determining value indexes
# class TestMakeKey(unittest.TestCase):
...
...
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