Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
atdb-ldv
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue 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
ASTRON SDC
atdb-ldv
Commits
fb0e4d56
Commit
fb0e4d56
authored
1 year ago
by
Nico Vermaas
Browse files
Options
Downloads
Patches
Plain Diff
add unit tests for joined operations
parent
81f6ffb0
No related branches found
No related tags found
1 merge request
!317
add unit tests for joined operations
Pipeline
#54561
passed
1 year ago
Stage: build
Stage: deploy_to_test
Stage: deploy_to_production
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
atdb/taskdatabase/tests/test_models_joins.py
+19
-2
19 additions, 2 deletions
atdb/taskdatabase/tests/test_models_joins.py
with
19 additions
and
2 deletions
atdb/taskdatabase/tests/test_models_joins.py
+
19
−
2
View file @
fb0e4d56
...
@@ -17,7 +17,7 @@ class TestJoinedTasks(TestCase):
...
@@ -17,7 +17,7 @@ class TestJoinedTasks(TestCase):
Task
.
objects
.
get_or_create
(
sas_id
=
1
,
status
=
'
stored
'
)
Task
.
objects
.
get_or_create
(
sas_id
=
1
,
status
=
'
stored
'
)
Task
.
objects
.
get_or_create
(
sas_id
=
2
,
status
=
'
stored
'
)
Task
.
objects
.
get_or_create
(
sas_id
=
2
,
status
=
'
stored
'
)
Task
.
objects
.
get_or_create
(
sas_id
=
3
,
status
=
'
defined
'
)
Task
.
objects
.
get_or_create
(
sas_id
=
3
,
status
=
'
defined
'
)
Task
.
objects
.
get_or_create
(
sas_id
=
4
,
status
=
'
defined
'
)
def
test_add_input_tasks_to_task
(
self
):
def
test_add_input_tasks_to_task
(
self
):
output_task
=
Task
.
objects
.
get
(
sas_id
=
1
)
output_task
=
Task
.
objects
.
get
(
sas_id
=
1
)
...
@@ -51,4 +51,21 @@ class TestJoinedTasks(TestCase):
...
@@ -51,4 +51,21 @@ class TestJoinedTasks(TestCase):
output_task
.
save
()
output_task
.
save
()
# two input tasks 'stored', should give: 'stored'
# two input tasks 'stored', should give: 'stored'
self
.
assertEqual
(
output_task
.
joined_status
,
"
stored
"
)
self
.
assertEqual
(
output_task
.
joined_status
,
"
stored
"
)
\ No newline at end of file
def
test_is_task_type_join
(
self
):
output_task
=
Task
.
objects
.
get
(
sas_id
=
3
)
input_task_1
=
Task
.
objects
.
get
(
sas_id
=
2
)
# stored
input_task_2
=
Task
.
objects
.
get
(
sas_id
=
1
)
# stored
regular_task_3
=
Task
.
objects
.
get
(
sas_id
=
4
)
output_task
.
joined_input_tasks
.
set
([
input_task_1
,
input_task_2
])
output_task
.
save
()
# the input task should be of the type 'join'
self
.
assertEqual
(
input_task_1
.
task_type_join
,
"
join
"
)
# the output task should be of the type 'joined'
self
.
assertEqual
(
output_task
.
task_type_join
,
"
joined
"
)
# a task without input/output tasks should be 'regular'
self
.
assertEqual
(
regular_task_3
.
task_type_join
,
"
regular
"
)
\ No newline at end of file
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