Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
persistent
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
persistent
Commits
f52aabd7
Commit
f52aabd7
authored
Apr 07, 2015
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Also make the str() value match betwenn C and Python TimeStamp objects; test this.
parent
1bc7c0e4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
persistent/tests/test_timestamp.py
persistent/tests/test_timestamp.py
+5
-0
persistent/timestamp.py
persistent/timestamp.py
+6
-0
No files found.
persistent/tests/test_timestamp.py
View file @
f52aabd7
...
...
@@ -192,6 +192,11 @@ class PyAndCComparisonTests(unittest.TestCase):
c
,
py
=
self
.
_make_C_and_Py
(
*
args
)
self
.
assertEqual
(
repr
(
c
),
repr
(
py
))
def
test_strs_equal
(
self
):
for
args
in
self
.
_make_many_instants
():
c
,
py
=
self
.
_make_C_and_Py
(
*
args
)
self
.
assertEqual
(
str
(
c
),
str
(
py
))
def
test_raw_equal
(
self
):
c
,
py
=
self
.
_make_C_and_Py
(
*
self
.
now_ts_args
)
self
.
assertEqual
(
c
.
raw
(),
py
.
raw
())
...
...
persistent/timestamp.py
View file @
f52aabd7
...
...
@@ -91,6 +91,12 @@ class pyTimeStamp(object):
def
__repr__
(
self
):
return
repr
(
self
.
_raw
)
def
__str__
(
self
):
return
"%4.4d-%2.2d-%2.2d %2.2d:%2.2d:%09.6f"
%
(
self
.
year
(),
self
.
month
(),
self
.
day
(),
self
.
hour
(),
self
.
minute
(),
self
.
second
())
def
year
(
self
):
return
self
.
_elements
[
0
]
...
...
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