Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mkexp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package Registry
Operate
Terraform modules
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
esmenv
mkexp
Commits
0403ce96
Commit
0403ce96
authored
2 months ago
by
Karl-Hermann Wieners
Browse files
Options
Downloads
Patches
Plain Diff
Config: add more patterns to period2sec test
parent
607a1283
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test.py
+22
-7
22 additions, 7 deletions
test.py
with
22 additions
and
7 deletions
test.py
+
22
−
7
View file @
0403ce96
...
...
@@ -459,13 +459,28 @@ class ContentTestCase(MkexpSimpleTestCase):
"""
)
def
test_period2sec
(
self
):
self
.
run_test
(
u
"""
%{VALUE}
"""
,
u
"""
93784
"""
,
u
"""
VALUE = period2sec(P1DT2H3M4S)
"""
)
template
=
""
expected
=
""
additional
=
""
for
i
in
range
(
1
,
16
):
period
=
(
"
P
"
+
(
"
1D
"
if
i
&
8
else
""
)
+
(
"
T
"
if
i
&
7
else
""
)
+
(
"
2H
"
if
i
&
4
else
""
)
+
(
"
3M
"
if
i
&
2
else
""
)
+
(
"
4S
"
if
i
&
1
else
""
)
)
seconds
=
(
(
86400
if
i
&
8
else
0
)
+
(
7200
if
i
&
4
else
0
)
+
(
180
if
i
&
2
else
0
)
+
(
4
if
i
&
1
else
0
)
)
template
+=
f
"
%{{VALUE
{
i
}
}}
\n
"
expected
+=
f
"
{
seconds
}
\n
"
additional
+=
f
"
VALUE
{
i
}
= period2sec(
{
period
}
)
\n
"
self
.
run_test
(
template
,
expected
,
additional
)
def
test_initial_comment_boilerplate
(
self
):
writeconfig
(
self
.
exp_id
,
u
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment