Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
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
Arkindex
Backend
Commits
f2477b4c
Commit
f2477b4c
authored
3 years ago
by
ml bonhomme
Browse files
Options
Downloads
Patches
Plain Diff
test worker run deletion on a started dataimport
parent
cb3b6e29
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1549
test worker run deletion on a started dataimport
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
arkindex/dataimport/tests/test_workerruns.py
+14
-1
14 additions, 1 deletion
arkindex/dataimport/tests/test_workerruns.py
with
14 additions
and
1 deletion
arkindex/dataimport/tests/test_workerruns.py
+
14
−
1
View file @
f2477b4c
...
...
@@ -7,7 +7,7 @@ from arkindex.dataimport.models import DataImportMode, WorkerRun, WorkerVersion
from
arkindex.dataimport.utils
import
get_default_farm_id
from
arkindex.project.tests
import
FixtureAPITestCase
from
arkindex.users.models
import
Role
from
ponos.models
import
Workflow
from
ponos.models
import
State
,
Workflow
RECIPE
=
'''
tasks:
...
...
@@ -577,6 +577,19 @@ class TestWorkerRuns(FixtureAPITestCase):
self
.
assertEqual
(
run_2
.
parents
,
[])
self
.
assertEqual
(
run_3
.
parents
,
[
run_2
.
id
])
def
test_delete_run_started_process
(
self
):
"""
A user shouldn
'
t be able to delete the worker run of a started process
"""
self
.
client
.
force_login
(
self
.
user
)
self
.
dataimport_1
.
start
()
self
.
dataimport_1
.
workflow
.
tasks
.
update
(
state
=
State
.
Running
)
response
=
self
.
client
.
delete
(
reverse
(
'
api:worker-run-details
'
,
kwargs
=
{
'
pk
'
:
str
(
self
.
run_1
.
id
)})
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_400_BAD_REQUEST
)
self
.
assertEqual
(
response
.
json
(),
{
'
__all__
'
:
[
"
Cannot update a WorkerRun on a DataImport that has already started
"
]})
def
test_build_task_recipe_no_parent
(
self
):
self
.
version_1
.
docker_image_id
=
ARTIFACT_ID
self
.
assertDictEqual
(
self
.
run_1
.
build_task_recipe
(
'
import
'
,
'
/data/import/elements.json
'
),
{
...
...
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