Skip to content
GitLab
Explore
Sign in
Register
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
c3ecf949
Commit
c3ecf949
authored
8 years ago
by
Jan David Mol
Browse files
Options
Downloads
Patches
Plain Diff
Task #9893: Fixed test broken by refactoring
parent
1e8ad504
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
SAS/ResourceAssignment/ResourceAssigner/test/t_schedulechecker.py
+4
-4
4 additions, 4 deletions
...urceAssignment/ResourceAssigner/test/t_schedulechecker.py
with
4 additions
and
4 deletions
SAS/ResourceAssignment/ResourceAssigner/test/t_schedulechecker.py
+
4
−
4
View file @
c3ecf949
...
...
@@ -57,7 +57,7 @@ class ScheduleCheckerTest(unittest.TestCase):
# Default return values
self
.
rarpc_mock
.
getTasks
.
return_value
=
[
{
'
id
'
:
'
id
'
,
'
mom_id
'
:
'
1
'
,
'
otdb_id
'
:
'
otdb_id
'
,
'
status
'
:
'
approved
'
,
'
type
'
:
'
observation
'
,
'
specification_id
'
:
'
specification_id
'
}
]
self
.
momrpc_mock
.
get
Pro
jectDetails
.
return_value
=
{
1
:
{
'
object_status
'
:
'
approved
'
}
}
self
.
momrpc_mock
.
get
Ob
jectDetails
.
return_value
=
{
1
:
{
'
object_status
'
:
'
approved
'
}
}
self
.
rarpc_mock
.
deleteSpecification
.
return_value
=
True
self
.
curpc_mock
.
getPathForOTDBId
.
return_value
=
{
'
found
'
:
True
}
...
...
@@ -138,7 +138,7 @@ class ScheduleCheckerTest(unittest.TestCase):
def
test_checkUnRunTasksForMoMOpenedStatus_mom_opened_otdb_approved
(
self
):
"""
Test if a MoM task on
'
opened
'
and in OTDB on
'
approved
'
causes the task to be deleted.
"""
self
.
momrpc_mock
.
get
Pro
jectDetails
.
return_value
=
{
1
:
{
'
object_status
'
:
'
opened
'
}
}
self
.
momrpc_mock
.
get
Ob
jectDetails
.
return_value
=
{
1
:
{
'
object_status
'
:
'
opened
'
}
}
with
TestingScheduleChecker
(
self
.
rarpc_mock
,
self
.
momrpc_mock
,
self
.
curpc_mock
)
as
schedulechecker
:
schedulechecker
.
checkUnRunTasksForMoMOpenedStatus
()
...
...
@@ -148,7 +148,7 @@ class ScheduleCheckerTest(unittest.TestCase):
def
test_checkUnRunTasksForMoMOpenedStatus_mom_approved_otdb_approved
(
self
):
"""
Test if a MoM task on
'
approved
'
and in OTDB on
'
approved
'
causes the task NOT to be deleted.
"""
self
.
momrpc_mock
.
get
Pro
jectDetails
.
return_value
=
{
1
:
{
'
object_status
'
:
'
approved
'
}
}
self
.
momrpc_mock
.
get
Ob
jectDetails
.
return_value
=
{
1
:
{
'
object_status
'
:
'
approved
'
}
}
with
TestingScheduleChecker
(
self
.
rarpc_mock
,
self
.
momrpc_mock
,
self
.
curpc_mock
)
as
schedulechecker
:
schedulechecker
.
checkUnRunTasksForMoMOpenedStatus
()
...
...
@@ -158,7 +158,7 @@ class ScheduleCheckerTest(unittest.TestCase):
def
test_checkUnRunTasksForMoMOpenedStatus_mom_notexisting_otdb_approved
(
self
):
"""
Test if a task is not in MoM, and
'
approved
'
in OTDB. This causes the task to be deleted.
"""
self
.
momrpc_mock
.
get
Pro
jectDetails
.
return_value
=
{}
self
.
momrpc_mock
.
get
Ob
jectDetails
.
return_value
=
{}
with
TestingScheduleChecker
(
self
.
rarpc_mock
,
self
.
momrpc_mock
,
self
.
curpc_mock
)
as
schedulechecker
:
schedulechecker
.
checkUnRunTasksForMoMOpenedStatus
()
...
...
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