Skip to content

Commit

Permalink
fix urgency detect payload
Browse files Browse the repository at this point in the history
  • Loading branch information
Hlamallama committed Sep 5, 2024
1 parent f20b6f4 commit f9af311
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion aaq/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ def test_urgency_check(self):
self.assertIn("details", response)
self.assertIn("is_urgent", response)
self.assertIn("matched_rules", response)
self.assertEqual(json.loads(request.request.body), message_text)
self.assertEqual(
json.loads(request.request.body), {"message_text": message_text}
)
self.assertIn("Bearer", request.request.headers["Authorization"])

assert response == {
Expand Down
4 changes: 3 additions & 1 deletion aaq/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ def check_urgency_v2(message_text):
"Content-Type": "application/json",
}

response = requests.request("POST", url, json=message_text, headers=headers)
response = requests.request(
"POST", url, json={"message_text": message_text}, headers=headers
)
response.raise_for_status()

return response.json()
Expand Down

0 comments on commit f9af311

Please sign in to comment.