Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
akihikokuroda committed May 3, 2024
1 parent 6004deb commit 8b454fb
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions gateway/tests/api/test_v1_program.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,35 +87,6 @@ def test_run_existing(self):
self.assertEqual(job.config.workers, None)
self.assertEqual(job.config.auto_scaling, True)

def test_run(self):
"""Tests run authorized."""

fake_file = ContentFile(b"print('Hello World')")
fake_file.name = "test_run.tar"

user = models.User.objects.get(username="test_user")
self.client.force_authenticate(user=user)

arguments = json.dumps({"MY_ARGUMENT_KEY": "MY_ARGUMENT_VALUE"})
env_vars = json.dumps({"MY_ENV_VAR_KEY": "MY_ENV_VAR_VALUE"})
programs_response = self.client.post(
"/api/v1/programs/run/",
data={
"title": "Program",
"entrypoint": "program.py",
"arguments": arguments,
"dependencies": "[]",
"env_vars": env_vars,
"artifact": fake_file,
},
)
job_id = programs_response.data.get("id")
job = Job.objects.get(id=job_id)
self.assertEqual(job.status, Job.QUEUED)
self.assertEqual(job.arguments, arguments)
self.assertEqual(job.program.dependencies, "[]")
self.assertEqual(job.program.env_vars, env_vars)

def test_runtime_job(self):
"""Tests run existing authorized."""

Expand Down

0 comments on commit 8b454fb

Please sign in to comment.