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
3cccd0d8
Commit
3cccd0d8
authored
Mar 15, 2002
by
Chris Withers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed tests for command line running, added tests for 'total' attribute.
parent
73592a00
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
lib/python/ZTUtils/tests/testBatch.py
lib/python/ZTUtils/tests/testBatch.py
+8
-3
No files found.
lib/python/ZTUtils/tests/testBatch.py
View file @
3cccd0d8
import
os
,
sys
,
unittest
import
os
,
sys
from
unittest
import
TestCase
,
makeSuite
,
main
import
string
from
ZTUtils
import
Batch
class
BatchTests
(
unittest
.
TestCase
):
class
BatchTests
(
TestCase
):
def
testEmpty
(
self
):
'''Test empty Batch'''
...
...
@@ -21,6 +23,7 @@ class BatchTests(unittest.TestCase):
assert
b
.
next
is
None
assert
b
.
start
==
1
,
b
.
start
assert
len
(
b
)
==
b
.
end
==
bsize
assert
b
.
total
==
len
(
seq
)
for
i
in
seq
:
assert
b
[
i
]
==
i
,
(
b
[
i
],
i
)
neg
=
-
1
-
i
...
...
@@ -33,12 +36,14 @@ class BatchTests(unittest.TestCase):
assert
b
.
next
is
None
assert
len
(
b
)
==
bsize
assert
b
[
bsize
-
1
]
==
bsize
-
1
assert
b
.
total
==
bsize
b
=
Batch
(
range
(
8
),
5
)
assert
len
(
b
)
==
5
assert
b
.
total
==
8
assert
len
(
b
.
next
)
==
3
def
test_suite
():
return
unittest
.
makeSuite
(
BatchTests
)
return
makeSuite
(
BatchTests
)
if
__name__
==
'__main__'
:
main
()
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