Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ZODB
Commits
e067bfed
Commit
e067bfed
authored
Jan 23, 2002
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test suite for TimeStamp.
parent
087380cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
0 deletions
+50
-0
src/ZODB/tests/testTimeStamp.py
src/ZODB/tests/testTimeStamp.py
+50
-0
No files found.
src/ZODB/tests/testTimeStamp.py
0 → 100644
View file @
e067bfed
"""Test the TimeStamp module."""
import
time
import
unittest
from
ZODB.TimeStamp
import
TimeStamp
class
TestTimeStamp
(
unittest
.
TestCase
):
def
checkTimeStamp
(
self
):
t
=
TimeStamp
(
2002
,
1
,
23
,
10
,
48
,
5
)
# GMT
self
.
assertEquals
(
str
(
t
),
'2002-01-23 10:48:05.000000'
)
self
.
assertEquals
(
repr
(
t
),
'
\
x03
B9H
\
x15
UUU'
)
self
.
assertEquals
(
TimeStamp
(
'
\
x03
B9H
\
x15
UUU'
),
t
)
self
.
assertEquals
(
t
.
year
(),
2002
)
self
.
assertEquals
(
t
.
month
(),
1
)
self
.
assertEquals
(
t
.
day
(),
23
)
self
.
assertEquals
(
t
.
hour
(),
10
)
self
.
assertEquals
(
t
.
minute
(),
48
)
self
.
assertEquals
(
round
(
t
.
second
()),
5
)
self
.
assertEquals
(
t
.
second
(),
t
.
seconds
())
# Alias
self
.
assertEquals
(
t
.
timeTime
(),
1011782885
)
t1
=
TimeStamp
(
2002
,
1
,
23
,
10
,
48
,
10
)
self
.
assertEquals
(
str
(
t1
),
'2002-01-23 10:48:10.000000'
)
self
.
assert_
(
t
==
t
)
self
.
assert_
(
t
!=
t1
)
self
.
assert_
(
t
<
t1
)
self
.
assert_
(
t
<=
t1
)
self
.
assert_
(
t1
>=
t
)
self
.
assert_
(
t1
>
t
)
self
.
failIf
(
t
==
t1
)
self
.
failIf
(
t
!=
t
)
self
.
failIf
(
t
>
t1
)
self
.
failIf
(
t
>=
t1
)
self
.
failIf
(
t1
<
t
)
self
.
failIf
(
t1
<=
t
)
self
.
assertEquals
(
cmp
(
t
,
t
),
0
)
self
.
assertEquals
(
cmp
(
t
,
t1
),
-
1
)
self
.
assertEquals
(
cmp
(
t1
,
t
),
1
)
self
.
assertEquals
(
t1
.
laterThan
(
t
),
t1
)
self
.
assert_
(
t
.
laterThan
(
t1
)
>
t1
)
self
.
assertEquals
(
TimeStamp
(
2002
,
1
,
23
),
TimeStamp
(
2002
,
1
,
23
,
0
,
0
,
0
))
def
test_suite
():
return
unittest
.
makeSuite
(
TestTimeStamp
,
'check'
)
if
__name__
==
"__main__"
:
loader
=
unittest
.
TestLoader
()
loader
.
testMethodPrefix
=
"check"
unittest
.
main
(
testLoader
=
loader
)
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