Skip to content
GitLab
Explore
Sign in
Register
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
7ecedf62
Commit
7ecedf62
authored
1 year ago
by
Nico Vermaas
Browse files
Options
Downloads
Patches
Plain Diff
handling review comments
parent
d2484344
No related branches found
No related tags found
1 merge request
!341
SDC-1188 - final merge
Pipeline
#72743
passed
1 year ago
Stage: test
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_update_activity.py
+28
-10
28 additions, 10 deletions
atdb/taskdatabase/tests/test_update_activity.py
with
28 additions
and
10 deletions
atdb/taskdatabase/tests/test_update_activity.py
+
28
−
10
View file @
7ecedf62
...
...
@@ -5,11 +5,14 @@ from taskdatabase.models import Task, Workflow, Activity
class
TestUpdateActivity
(
TestCase
):
def
setUp
(
self
):
"""
initialize test data
"""
self
.
workflow_requantisation
=
Workflow
(
id
=
22
,
workflow_uri
=
"
psrfits_requantisation
"
)
self
.
workflow_requantisation
.
save
()
self
.
task1
=
Task
.
objects
.
create
(
sas_id
=
12345
,
filter
=
"
nv_19feb_2024
"
,
filter
=
"
test_blabla
"
,
status
=
'
stored
'
,
workflow
=
self
.
workflow_requantisation
,
calculated_qualities
=
{
"
per_task
"
:
"
good
"
,
"
per_sasid
"
:
"
good
"
})
...
...
@@ -44,7 +47,9 @@ class TestUpdateActivity(TestCase):
size_processed
=
500
)
def
test_created_activity
(
self
):
"""
test if activity is created
"""
activity
=
self
.
task1
.
activity
# test if an activity with the correct sas_id was created
...
...
@@ -53,8 +58,9 @@ class TestUpdateActivity(TestCase):
def
test_stored
(
self
):
# test if the activity gets the calculated quality of the sas_id of the stored task
"""
test if the activity gets the calculated quality of the sas_id of the stored task
"""
activity
=
self
.
task1
.
activity
actual
=
activity
.
calculated_quality
...
...
@@ -62,7 +68,9 @@ class TestUpdateActivity(TestCase):
def
test_scrubbed
(
self
):
# test if the activity gets the ingested_fraction of an archived task
"""
test if the activity gets the ingested_fraction of 0 when scrubbed
"""
activity
=
self
.
task2
.
activity
actual
=
activity
.
ingestq_status
...
...
@@ -73,7 +81,9 @@ class TestUpdateActivity(TestCase):
def
test_archived
(
self
):
# test if the activity gets the ingested_fraction of an archived task
"""
test if the activity gets the ingested_fraction of an archived task
"""
activity
=
self
.
task3
.
activity
actual
=
activity
.
ingestq_status
...
...
@@ -84,7 +94,10 @@ class TestUpdateActivity(TestCase):
def
test_finished
(
self
):
# test if the activity gets the ingested_fraction of an archived task
"""
test if the activity gets the proper values from
'
archived
'
json of a finished task
"""
activity
=
self
.
task4
.
activity
actual
=
activity
.
ingestq_status
...
...
@@ -95,7 +108,10 @@ class TestUpdateActivity(TestCase):
def
test_failed
(
self
):
# test if the activity gets the ingested_fraction of an archived task
"""
test if the activity gets the ingested_fraction of an archived task
"""
activity
=
self
.
task5
.
activity
actual
=
activity
.
finished_fraction
...
...
@@ -109,12 +125,14 @@ class TestUpdateActivity(TestCase):
def
test_filter_and_workflow
(
self
):
"""
test if the activity gets the filter and workflow_id of updated tasks
"""
# test if the activity gets the calculated quality of the sas_id of the stored task
activity
=
self
.
task1
.
activity
actual
=
activity
.
filter
self
.
assertEqual
(
actual
,
"
nv_19feb_2024
"
)
self
.
assertEqual
(
actual
,
"
test_blabla
"
)
actual
=
activity
.
workflow_id
self
.
assertEqual
(
actual
,
22
)
...
...
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