Skip to content

Commit

Permalink
Fix formatting of message and add test
Browse files Browse the repository at this point in the history
  • Loading branch information
perlpunk committed May 17, 2024
1 parent fe5969f commit 1e15a22
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion backlogger.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def _update_issue_priority(poo_id, priority_current, poo_reminder_state, msg):
slo_priorities[priority_current]["next_priority"]["name"],
poo_id))
url = "{}/{}.json".format(data["web"], poo_id)
msg = " ".join([reminder_text, update_slo_text.format(
msg = " ".join([reminder_text.format(priority=priority_current, url=data["url"]), update_slo_text.format(
priority=slo_priorities[priority_current]["next_priority"]["name"])])
json_rest("PUT", url,
{"issue":
Expand Down
17 changes: 17 additions & 0 deletions tests/test_comments.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,23 @@ def test_automatic_priority_on_issue(self):
out, err = self.capsys.readouterr()
assert re.search(expected_str.format(params[0],
params[1]), out)
calls = [
call(
"GET",
"https://example.com/wiki/1000.json?include=journals",
),
call(
"PUT",
"https://example.com/wiki/1000.json",
{
"issue": {
"priority_id": 3,
"notes": "This ticket was set to **Normal** priority but was not updated [within the SLO period](https://example.com/issues). Please consider picking up this ticket or just set the ticket to the next lower priority. The ticket will be set to the next lower priority **Low**."
}
},
),
]
backlogger.json_rest.assert_has_calls(calls)


def test_issue_with_low_priority_never_change(self):
Expand Down

0 comments on commit 1e15a22

Please sign in to comment.