Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
zodbtools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
4
Merge Requests
4
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
zodbtools
Commits
877b973c
Commit
877b973c
authored
Jan 29, 2019
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test_tidrange: code format
parent
1343136d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
12 deletions
+15
-12
zodbtools/test/test_tidrange.py
zodbtools/test/test_tidrange.py
+15
-12
No files found.
zodbtools/test/test_tidrange.py
View file @
877b973c
...
...
@@ -38,9 +38,9 @@ def fake_time():
os
.
environ
[
"TZ"
]
=
"Europe/Paris"
time
.
tzset
()
reference_time
=
datetime
.
datetime
(
2009
,
8
,
30
,
19
,
20
,
0
,
0
,
pytz
.
utc
).
astimezone
(
pytz
.
timezone
(
"Europe/Paris"
)
)
reference_time
=
datetime
.
datetime
(
2009
,
8
,
30
,
19
,
20
,
0
,
0
,
pytz
.
utc
).
astimezone
(
pytz
.
timezone
(
"Europe/Paris"
)
)
with
freeze_time
(
reference_time
):
yield
del
os
.
environ
[
"TZ"
]
...
...
@@ -55,13 +55,11 @@ def test_tidrange_tid():
b"
\
x00
\
x00
\
x00
\
x00
\
x00
\
x00
\
xbb
\
xbb
"
,
)
==
parse_tidrange
(
"000000000000aaaa..000000000000bbbb"
)
assert
(
b"
\
x00
\
x00
\
x00
\
x00
\
x00
\
x00
\
xaa
\
xaa
"
,
None
)
==
parse_tidrange
(
"000000000000aaaa.."
)
assert
(
b"
\
x00
\
x00
\
x00
\
x00
\
x00
\
x00
\
xaa
\
xaa
"
,
None
)
==
parse_tidrange
(
"000000000000aaaa.."
)
assert
(
None
,
b"
\
x00
\
x00
\
x00
\
x00
\
x00
\
x00
\
xbb
\
xbb
"
)
==
parse_tidrange
(
"..000000000000bbbb"
)
assert
(
None
,
b"
\
x00
\
x00
\
x00
\
x00
\
x00
\
x00
\
xbb
\
xbb
"
)
==
parse_tidrange
(
"..000000000000bbbb"
)
assert
(
None
,
None
)
==
parse_tidrange
(
".."
)
...
...
@@ -74,7 +72,10 @@ def test_tidrange_date():
assert
(
b"
\
x03
\
xc4
\
x85
v
\
x00
\
x00
\
x00
\
x00
"
,
b"
\
x03
\
xc4
\
x88
\
xa0
\
x00
\
x00
\
x00
\
x00
"
,
)
==
parse_tidrange
(
"2018-01-01T10:30:00Z..2018-01-02T00:00:00.000000+00:00"
)
)
==
parse_tidrange
(
"2018-01-01T10:30:00Z..2018-01-02T00:00:00.000000+00:00"
)
test_parameters
=
[]
...
...
@@ -88,6 +89,8 @@ with open(
test_parameters
.
append
(
line
.
split
(
" "
,
2
))
@
pytest
.
mark
.
parametrize
(
"reference_time,reference_tid,input_time"
,
test_parameters
)
def
test_parse_tid_time_format
(
fake_time
,
reference_time
,
reference_tid
,
input_time
):
@
pytest
.
mark
.
parametrize
(
"reference_time,reference_tid,input_time"
,
test_parameters
)
def
test_parse_tid_time_format
(
fake_time
,
reference_time
,
reference_tid
,
input_time
):
assert
reference_tid
==
ashex
(
parse_tid
(
input_time
))
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