Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RadioObservatory
LOFAR
Commits
426cf3ce
Commit
426cf3ce
authored
4 years ago
by
Mario Raciti
Browse files
Options
Downloads
Patches
Plain Diff
TMSS-672
: Add more tests for the 'at' constraint
parent
6cb0ae3e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!394
Resolve TMSS-672
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
SAS/TMSS/backend/services/scheduling/test/t_dynamic_scheduling.py
+24
-2
24 additions, 2 deletions
.../backend/services/scheduling/test/t_dynamic_scheduling.py
with
24 additions
and
2 deletions
SAS/TMSS/backend/services/scheduling/test/t_dynamic_scheduling.py
+
24
−
2
View file @
426cf3ce
...
@@ -1103,7 +1103,7 @@ class TestTimeConstraints(TestCase):
...
@@ -1103,7 +1103,7 @@ class TestTimeConstraints(TestCase):
def
test_can_run_within_at_constraint
(
self
):
def
test_can_run_within_at_constraint
(
self
):
"""
"""
Test
"
at
"
constraint
Test
"
at
"
constraint
with both boundary and
'
inside
'
upper_bound and lower_bound
"""
"""
# no constraints defined so should be OK
# no constraints defined so should be OK
self
.
clear_time_constraints
()
self
.
clear_time_constraints
()
...
@@ -1123,13 +1123,35 @@ class TestTimeConstraints(TestCase):
...
@@ -1123,13 +1123,35 @@ class TestTimeConstraints(TestCase):
datetime
(
2020
,
1
,
1
,
12
,
0
,
0
),
datetime
(
2020
,
1
,
1
,
12
,
0
,
0
),
datetime
(
2020
,
1
,
1
,
14
,
0
,
0
)))
datetime
(
2020
,
1
,
1
,
14
,
0
,
0
)))
# Set datetime constraint at upper_bound
self
.
clear_time_constraints
()
self
.
add_time_at_constraint
(
datetime
(
2020
,
1
,
1
,
14
,
0
,
0
))
self
.
assertFalse
(
tc1
.
can_run_within_timewindow_with_time_constraints
(
self
.
scheduling_unit_blueprint
,
datetime
(
2020
,
1
,
1
,
12
,
0
,
0
),
datetime
(
2020
,
1
,
1
,
14
,
0
,
0
)))
# Set datetime constraint after upper_bound
# Set datetime constraint after upper_bound
self
.
clear_time_constraints
()
self
.
clear_time_constraints
()
self
.
add_time_at_constraint
(
datetime
(
2020
,
1
,
2
,
15
,
0
,
0
))
self
.
add_time_at_constraint
(
datetime
(
2020
,
1
,
1
,
15
,
0
,
0
))
self
.
assertFalse
(
tc1
.
can_run_within_timewindow_with_time_constraints
(
self
.
scheduling_unit_blueprint
,
self
.
assertFalse
(
tc1
.
can_run_within_timewindow_with_time_constraints
(
self
.
scheduling_unit_blueprint
,
datetime
(
2020
,
1
,
1
,
12
,
0
,
0
),
datetime
(
2020
,
1
,
1
,
12
,
0
,
0
),
datetime
(
2020
,
1
,
1
,
14
,
0
,
0
)))
datetime
(
2020
,
1
,
1
,
14
,
0
,
0
)))
# Set datetime constraint at lower_bound
self
.
clear_time_constraints
()
self
.
add_time_at_constraint
(
datetime
(
2020
,
1
,
1
,
12
,
0
,
0
))
self
.
assertTrue
(
self
.
execute_can_run_within_timewindow_with_time_constraints_of_24hour_boundary
())
# Set datetime constraint that fits the time window
self
.
clear_time_constraints
()
self
.
add_time_at_constraint
(
datetime
(
2020
,
1
,
1
,
18
,
30
,
0
))
self
.
assertTrue
(
self
.
execute_can_run_within_timewindow_with_time_constraints_of_24hour_boundary
())
# Set datetime constraint so that obs lasts till exactly upper_bound
self
.
clear_time_constraints
()
self
.
add_time_at_constraint
(
datetime
(
2020
,
1
,
2
,
9
,
50
,
0
))
self
.
assertTrue
(
self
.
execute_can_run_within_timewindow_with_time_constraints_of_24hour_boundary
())
def
test_can_run_within_between_constraints
(
self
):
def
test_can_run_within_between_constraints
(
self
):
"""
"""
Test multiple
'
between
'
constraints within 24 boundary and check overall result of
Test multiple
'
between
'
constraints within 24 boundary and check overall result of
...
...
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