Skip to content

Commit 2dc4073

Browse files
committed
Format the code
1 parent 43a9e68 commit 2dc4073

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

zulip_bots/zulip_bots/bots/bugzilla/bugzilla.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
Then `A new comment` is added to bug 123
2424
'''
2525

26+
2627
class BugzillaHandler(object):
2728
'''
2829
A docstring documenting this bot.
@@ -51,7 +52,7 @@ def handle_message(self, message: Dict[str, str], bot_handler: Any) -> None:
5152
content = message.get('content')
5253
topic = message.get('subject')
5354

54-
if HELP_REGEX.match (content):
55+
if HELP_REGEX.match(content):
5556
self.handle_help(message, bot_handler)
5657
return None
5758

@@ -63,19 +64,19 @@ def handle_message(self, message: Dict[str, str], bot_handler: Any) -> None:
6364

6465
comment = content
6566
self.handle_comment(bug_number, comment, message, bot_handler)
66-
67+
6768
def handle_help(self, message: Dict[str, str], bot_handler: Any) -> None:
6869
bot_handler.send_reply(message, HELP_RESPONSE)
6970

7071
def handle_comment(self, bug_number: str, comment: str, message: Dict[str, str], bot_handler: Any) -> None:
7172
url = '{}/rest/bug/{}/comment'.format(self.site, bug_number)
72-
requests.post (url,
73-
json=self.make_comment_json(comment))
73+
requests.post(url,
74+
json=self.make_comment_json(comment))
7475

7576
def make_comment_json(self, comment: str) -> Any:
7677
json = {
77-
'api_key': self.api_key,
78-
'comment': comment
78+
'api_key': self.api_key,
79+
'comment': comment
7980
}
8081
return json
8182

@@ -87,4 +88,5 @@ def extract_bug_number(self, topic: str) -> Any:
8788
else:
8889
return topic_match.group('bug_number')
8990

91+
9092
handler_class = BugzillaHandler

zulip_bots/zulip_bots/bots/bugzilla/fixtures/test_comment.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
"status": 200,
1515
"content-type": "application/json; charset=utf-8"
1616
}
17-
}
17+
}

zulip_bots/zulip_bots/bots/bugzilla/test_bugzilla.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from unittest.mock import patch
33
from zulip_bots.test_lib import BotTestCase, DefaultTests
44

5+
56
class TestBugzillaBot(BotTestCase, DefaultTests):
67
bot_name = 'bugzilla'
78

@@ -69,6 +70,7 @@ def test_help(self) -> None:
6970
with self.mock_config_info(self.MOCK_CONFIG_INFO):
7071
self.verify_reply('help', self.MOCK_HELP_RESPONSE)
7172

73+
7274
class TestBugzillaBotWrongTopic(BotTestCase, DefaultTests):
7375
bot_name = 'bugzilla'
7476

@@ -89,4 +91,5 @@ def test_bot_responds_to_empty_message(self) -> None:
8991

9092
def test_no_bug_number(self) -> None:
9193
with self.mock_config_info(self.MOCK_CONFIG_INFO):
92-
self.verify_reply('a comment', self.MOCK_COMMENT_INVALID_TOPIC_RESPONSE)
94+
self.verify_reply(
95+
'a comment', self.MOCK_COMMENT_INVALID_TOPIC_RESPONSE)

0 commit comments

Comments
 (0)