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
8f06ece1
Commit
8f06ece1
authored
Aug 05, 2010
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document my test debt
parent
f1478441
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
5 deletions
+40
-5
src/Products/ZCatalog/tests/test_plan.py
src/Products/ZCatalog/tests/test_plan.py
+40
-5
No files found.
src/Products/ZCatalog/tests/test_plan.py
View file @
8f06ece1
...
@@ -13,6 +13,8 @@
...
@@ -13,6 +13,8 @@
import
unittest
import
unittest
from
zope.testing
import
cleanup
class
dummy
(
object
):
class
dummy
(
object
):
...
@@ -26,9 +28,21 @@ class dummy(object):
...
@@ -26,9 +28,21 @@ class dummy(object):
return
(
self
.
num
,
self
.
num
+
1
)
return
(
self
.
num
,
self
.
num
+
1
)
class
TestCatalogPlan
(
unittest
.
TestCase
):
# class TestNestedDict(unittest.TestCase):
# class TestPriorityMap(unittest.TestCase):
# class TestReports(unittest.TestCase):
# class TestValueIndexes(unittest.TestCase):
# class TestMakeKey(unittest.TestCase):
class
TestCatalogPlan
(
cleanup
.
CleanUp
,
unittest
.
TestCase
):
def
setUp
(
self
):
def
setUp
(
self
):
cleanup
.
CleanUp
.
setUp
(
self
)
from
Products.ZCatalog.ZCatalog
import
ZCatalog
from
Products.ZCatalog.ZCatalog
import
ZCatalog
self
.
zcat
=
ZCatalog
(
'catalog'
)
self
.
zcat
=
ZCatalog
(
'catalog'
)
self
.
zcat
.
long_query_time
=
0.0
self
.
zcat
.
long_query_time
=
0.0
...
@@ -40,9 +54,30 @@ class TestCatalogPlan(unittest.TestCase):
...
@@ -40,9 +54,30 @@ class TestCatalogPlan(unittest.TestCase):
obj
=
dummy
(
i
)
obj
=
dummy
(
i
)
self
.
zcat
.
catalog_object
(
obj
,
str
(
i
))
self
.
zcat
.
catalog_object
(
obj
,
str
(
i
))
def
tearDown
(
self
):
# get_id
from
Products.ZCatalog.plan
import
ValueIndexes
# init_timer
ValueIndexes
.
clear
()
# plan
# start
# start_split
# stop_split
# stop
# log
class
TestCatalogReport
(
cleanup
.
CleanUp
,
unittest
.
TestCase
):
def
setUp
(
self
):
cleanup
.
CleanUp
.
setUp
(
self
)
from
Products.ZCatalog.ZCatalog
import
ZCatalog
self
.
zcat
=
ZCatalog
(
'catalog'
)
self
.
zcat
.
long_query_time
=
0.0
self
.
zcat
.
addIndex
(
'num'
,
'FieldIndex'
)
self
.
zcat
.
addIndex
(
'big'
,
'FieldIndex'
)
self
.
zcat
.
addIndex
(
'numbers'
,
'KeywordIndex'
)
for
i
in
range
(
9
):
obj
=
dummy
(
i
)
self
.
zcat
.
catalog_object
(
obj
,
str
(
i
))
def
test_ReportLength
(
self
):
def
test_ReportLength
(
self
):
""" tests the report aggregation """
""" tests the report aggregation """
...
@@ -108,5 +143,5 @@ class TestCatalogPlan(unittest.TestCase):
...
@@ -108,5 +143,5 @@ class TestCatalogPlan(unittest.TestCase):
def
test_suite
():
def
test_suite
():
suite
=
unittest
.
TestSuite
()
suite
=
unittest
.
TestSuite
()
suite
.
addTest
(
unittest
.
makeSuite
(
TestCatalog
Plan
))
suite
.
addTest
(
unittest
.
makeSuite
(
TestCatalog
Report
))
return
suite
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