Skip to content

Commit

Permalink
fix: fix test for billing check
Browse files Browse the repository at this point in the history
  • Loading branch information
pieterlukasse committed Nov 13, 2023
1 parent f86a632 commit b94b7b0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
3 changes: 2 additions & 1 deletion src/argowrapper/routes/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,9 @@ def submit_workflow(
) -> str:
"""route to submit workflow"""
try:
# check if user has a billing id tag"""
# check if user has a billing id tag:
billing_id = check_user_billing_id(request)
# submit workflow:
return argo_engine.workflow_submission(
request_body, request.headers.get("Authorization"), billing_id
)
Expand Down
19 changes: 10 additions & 9 deletions test/test_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,12 +515,13 @@ def test_check_user_billing_id(client):

mock_resp.status_code == 500
mock_resp.raise_for_status.side_effect = Exception("fence is down")
with pytest.raises(Exception):
response = client.post(
"/submit",
data=json.dumps(data),
headers={
"Content-Type": "application/json",
"Authorization": EXAMPLE_AUTH_HEADER,
},
)
response = client.post(
"/submit",
data=json.dumps(data),
headers={
"Content-Type": "application/json",
"Authorization": EXAMPLE_AUTH_HEADER,
},
)
assert response.status_code == 500
assert "fence is down" in str(response.content)

0 comments on commit b94b7b0

Please sign in to comment.