Commit 45c36513 authored by Lionel Walter's avatar Lionel Walter
Browse files

Move JobStart to HelmStart and JobStop to HelmStop

parent 40eaebf2
......@@ -12,6 +12,8 @@ from import_api_app.resources.KafkaTopics import KafkaTopics
import import_api_app.configuration
from import_api_app.resources.WriteJobResultsToDrupal import WriteJobResultToDrupal
from import_api_app.resources.ReadJobOptionsFromDrupal import ReadJobOptionsFromDrupal
from import_api_app.resources.HelmStart import HelmStart
from import_api_app.resources.HelmStop import HelmStop
import os
......@@ -63,6 +65,13 @@ def create_app(test_config=None):
'/v1/job/<institution_id>/<record_set_id>/<process_id>/<job_name>/start'
)
api.add_resource(JobStop, '/v1/job/<process_id>/<job_name>/stop')
api.add_resource(
HelmStart,
'/v1/helm/<institution_id>/<record_set_id>/<process_id>/<job_name>/start'
)
api.add_resource(HelmStop, '/v1/helm/<process_id>/<job_name>/stop')
api.add_resource(Job, '/v1/job/<process_id>/<job_name>')
api.add_resource(WriteJobResultToDrupal, '/v1/drupal/<job_log_drupal_uuid>/<report>')
api.add_resource(ReadJobOptionsFromDrupal, '/v1/drupal/<job_name>/<job_drupal_uuid>')
......
......@@ -20,7 +20,7 @@ def test_job_start(client):
jobs_json = jobs_response.get_json()
number_of_jobs_before = len(jobs_json)
response = client.post('/v1/job/123/456/789/text-file-validation/start', json={
response = client.post('/v1/helm/123/456/789/text-file-validation/start', json={
"job-parameters": {
"appDirectory": "AFZ/AfZ-Becker-Audiovisuals"
}
......@@ -34,7 +34,7 @@ def test_job_start(client):
assert number_of_jobs_after == number_of_jobs_before + 1
# try to start a second job with same job id
response = client.post('/v1/job/123/456/789/text-file-validation/start', json={
response = client.post('/v1/helm/123/456/789/text-file-validation/start', json={
"job-parameters": {
"appDirectory": "AFZ/AfZ-Becker-Audiovisuals"
}
......@@ -42,7 +42,7 @@ def test_job_start(client):
assert response.status_code == 500
# use invalid chart name
response = client.post('/v1/job/123/456/789/TESTTEST/start', json={
response = client.post('/v1/helm/123/456/789/TESTTEST/start', json={
"job-parameters": {
"appDirectory": "AFZ/AfZ-Becker-Audiovisuals",
}
......@@ -59,13 +59,13 @@ def test_get_job(client):
def test_job_stop(client):
response = client.delete('/v1/job/789/text-file-validation/stop')
response = client.delete('/v1/helm/789/text-file-validation/stop')
assert response.status_code == 200
response = client.delete('/v1/job/789/jdskfhjkdshjkewhrjkewrjkewhjkhrjkewhr/stop')
response = client.delete('/v1/helm/789/jdskfhjkdshjkewhrjkewrjkewhjkhrjkewhr/stop')
assert response.status_code == 500
response = client.get('/v1/job/789/text-file-validation')
response = client.get('/v1/helm/789/text-file-validation')
assert response.status_code == 404
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment