Skip to content

Commit

Permalink
forgot headers
Browse files Browse the repository at this point in the history
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
  • Loading branch information
vsoch committed Nov 10, 2022
1 parent 592add0 commit 560971c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/test_api_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,15 @@ def test_cancel_job():
def test_job_output():

# Now submit a job, ensure we get one job back
response = client.post("/jobs/submit", json={"command": "echo pancakes 🥞️🥞️🥞️"})
headers = get_headers()

response = client.post(
"/jobs/submit", json={"command": "echo pancakes 🥞️🥞️🥞️"}, headers=headers
)
assert response.status_code == 200
result = response.json()
jobid = result["id"]
res = client.get(f"/jobs/{jobid}/output")
res = client.get(f"/jobs/{jobid}/output", headers=headers)
assert response.status_code == 200
lines = res.json()

Expand All @@ -94,7 +98,7 @@ def test_job_output():
time.sleep(3)

# Try again - we should have it after a sleep
res = client.get(f"/jobs/{jobid}/output")
res = client.get(f"/jobs/{jobid}/output", headers=headers)
assert response.status_code == 200
lines = res.json()
assert "Output" in lines
Expand Down

0 comments on commit 560971c

Please sign in to comment.