From 934096ecce00f39eb165e58cb1413ebaf24207b8 Mon Sep 17 00:00:00 2001 From: sidpremkumar Date: Jul 18 2019 13:51:48 +0000 Subject: Removing hours from comments, and removing hours from status --- diff --git a/sync2jira/downstream.py b/sync2jira/downstream.py index 7f3c711..8939529 100644 --- a/sync2jira/downstream.py +++ b/sync2jira/downstream.py @@ -51,11 +51,9 @@ def _comment_format(comment): Returns: Response (str): Comments formatted """ - pretty_date = comment['date_created'].strftime("%a %b %d - %-I:%M%p") - + pretty_date = comment['date_created'].strftime("%a %b %d") return "[%s] Upstream, %s wrote [%s]:\n\n{quote}\n%s\n{quote}" % ( - comment['id'], comment['author'], - pretty_date, comment['body']) + comment['id'], comment['author'], pretty_date, comment['body']) def _comment_format_legacy(comment): @@ -652,7 +650,7 @@ def _update_transition(client, existing, issue): # Format the status today = datetime.today() formatted_status = "[%s] Upstream issue status: %s" % ( - today.strftime("%a %b %y - %H:%M"), issue.status) + today.strftime("%a %b %y"), issue.status) new_description = existing.fields.description # Check if the issue has the issue status line if "] Upstream issue status:" in existing.fields.description: diff --git a/tests/test_downstream.py b/tests/test_downstream.py index 6553428..1659880 100644 --- a/tests/test_downstream.py +++ b/tests/test_downstream.py @@ -551,7 +551,7 @@ class TestDownstream(unittest.TestCase): ) # Assert all calls were made correctly - self.mock_today.strftime.assert_called_with("%a %b %y - %H:%M") + self.mock_today.strftime.assert_called_with("%a %b %y") self.mock_downstream.update.assert_called_with({'description': '[mock_today] Upstream issue status: Closed\n'}) mock_client.transitions.assert_called_with(self.mock_downstream) mock_client.transition_issue.asert_called_with(self.mock_downstream, 1234) @@ -580,7 +580,7 @@ class TestDownstream(unittest.TestCase): ) # Assert all calls were made correctly - self.mock_today.strftime.assert_called_with("%a %b %y - %H:%M") + self.mock_today.strftime.assert_called_with("%a %b %y") self.mock_downstream.update.assert_called_with({'description': '[mock_today] Upstream issue status: Closed\n'}) mock_client.transitions.assert_called_with(self.mock_downstream) mock_client.transition_issue.asert_called_with(self.mock_downstream, 1234) @@ -607,7 +607,7 @@ class TestDownstream(unittest.TestCase): ) # Assert all calls were made correctly - self.mock_today.strftime.assert_called_with("%a %b %y - %H:%M") + self.mock_today.strftime.assert_called_with("%a %b %y") self.mock_downstream.update.assert_called_with({'description': '[mock_today] Upstream issue status: Closed'}) mock_client.transitions.assert_called_with(self.mock_downstream) mock_client.transition_issue.asert_called_with(self.mock_downstream, 1234)