Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 3f495d4f authored by LETORT Sebastien's avatar LETORT Sebastien
Browse files

Job are automatically archived after a month.

To test download_file, I used a fixed job id. I changed it to an id from a job created especially with run_job.
Only test_download_file is altered.
parent e8dcc38c
No related branches found
No related tags found
1 merge request!4Client api
Pipeline #121548 failed
...@@ -25,10 +25,6 @@ class ApiClientIntegration: ...@@ -25,10 +25,6 @@ class ApiClientIntegration:
def _build_client(cls): def _build_client(cls):
raise NotImplementedError raise NotImplementedError
@classmethod
def _get_job_id(cls):
raise NotImplementedError
@pytest.mark.error @pytest.mark.error
def test_create_job__user_not_exist(self): def test_create_job__user_not_exist(self):
"""create a job with a token that refers to no one. """create a job with a token that refers to no one.
...@@ -141,10 +137,10 @@ class ApiClientIntegration: ...@@ -141,10 +137,10 @@ class ApiClientIntegration:
The job queried exists and belongs to the testing user. The job queried exists and belongs to the testing user.
""" """
JOB_ID = self._get_job_id() job_run = self.CLIENT.run_job(self.TEST_APP)
response = self.CLIENT.job_status(JOB_ID) JOB_ID = job_run['id']
file_url = response[str(JOB_ID)]['allgo.log'] file_url = job_run[str(JOB_ID)]['allgo.log']
filepath = self.CLIENT.download_file(file_url, outdir=tmp_path) filepath = self.CLIENT.download_file(file_url, outdir=tmp_path)
assert filepath.startswith(str(tmp_path)) assert filepath.startswith(str(tmp_path))
...@@ -165,11 +161,6 @@ class TestAllgo18(ApiClientIntegration): ...@@ -165,11 +161,6 @@ class TestAllgo18(ApiClientIntegration):
def _build_client(cls, token): def _build_client(cls, token):
return Client(token) return Client(token)
@classmethod
def _get_job_id(cls):
"""return a job id that exist, with a log file named allgo.log"""
return 874
def setup_class(cls): def setup_class(cls):
"""define the client used in tests. """define the client used in tests.
It uses a token defined in as env variable.""" It uses a token defined in as env variable."""
...@@ -187,11 +178,6 @@ class TestAllgoDev(ApiClientIntegration): ...@@ -187,11 +178,6 @@ class TestAllgoDev(ApiClientIntegration):
return Client(token, allgo_url=ALLGO_URL, verify_tls=False) return Client(token, allgo_url=ALLGO_URL, verify_tls=False)
@classmethod
def _get_job_id(cls):
"""return a job id that exist, with a log file named allgo.log"""
return 37
@classmethod @classmethod
def setup_class(cls): def setup_class(cls):
"""define the client used in local instance. """define the client used in local instance.
...@@ -220,11 +206,6 @@ class TestAllgoOld(ApiClientIntegration): ...@@ -220,11 +206,6 @@ class TestAllgoOld(ApiClientIntegration):
return Client(token, allgo_url=ALLGO_URL) return Client(token, allgo_url=ALLGO_URL)
@classmethod
def _get_job_id(cls):
"""return a job id that exist, with a log file named allgo.log"""
return 72597
def setup_class(cls): def setup_class(cls):
"""define the client used in local instance. """define the client used in local instance.
It uses a token defined in as env variable.""" It uses a token defined in as env variable."""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment