trello: Remove extra newlines & spaces in code and tests.
This commit is contained in:
parent
4f224b5dbc
commit
8f0b9adb70
|
@ -54,12 +54,12 @@ class TestTrelloBot(BotTestCase):
|
||||||
bot_instance = TrelloHandler()
|
bot_instance = TrelloHandler()
|
||||||
bot_instance.initialize(StubBotHandler)
|
bot_instance.initialize(StubBotHandler)
|
||||||
|
|
||||||
self.assertEqual(bot_instance.get_board_descs(['TEST']), '1.[TEST](TEST) (`TEST`)\n')
|
self.assertEqual(bot_instance.get_board_descs(['TEST']), '1.[TEST](TEST) (`TEST`)')
|
||||||
|
|
||||||
def test_get_all_cards_command(self) -> None:
|
def test_get_all_cards_command(self) -> None:
|
||||||
with self.mock_config_info(mock_config), patch('requests.get'):
|
with self.mock_config_info(mock_config), patch('requests.get'):
|
||||||
with self.mock_http_conversation('get_cards'):
|
with self.mock_http_conversation('get_cards'):
|
||||||
self.verify_reply('get-all-cards TEST', '**Cards:** \n1. [TEST](TEST) (`TEST`)\n')
|
self.verify_reply('get-all-cards TEST', '**Cards:**\n1. [TEST](TEST) (`TEST`)')
|
||||||
|
|
||||||
def test_get_all_checklists_command(self) -> None:
|
def test_get_all_checklists_command(self) -> None:
|
||||||
with self.mock_config_info(mock_config), patch('requests.get'):
|
with self.mock_config_info(mock_config), patch('requests.get'):
|
||||||
|
@ -67,7 +67,7 @@ class TestTrelloBot(BotTestCase):
|
||||||
self.verify_reply('get-all-checklists TEST', '**Checklists:**\n'
|
self.verify_reply('get-all-checklists TEST', '**Checklists:**\n'
|
||||||
'1. `TEST`:\n'
|
'1. `TEST`:\n'
|
||||||
' * [X] TEST_1\n * [X] TEST_2\n'
|
' * [X] TEST_1\n * [X] TEST_2\n'
|
||||||
' * [-] TEST_3\n * [-] TEST_4\n')
|
' * [-] TEST_3\n * [-] TEST_4')
|
||||||
|
|
||||||
def test_get_all_lists_command(self) -> None:
|
def test_get_all_lists_command(self) -> None:
|
||||||
with self.mock_config_info(mock_config), patch('requests.get'):
|
with self.mock_config_info(mock_config), patch('requests.get'):
|
||||||
|
@ -76,7 +76,7 @@ class TestTrelloBot(BotTestCase):
|
||||||
'1. TEST_A\n'
|
'1. TEST_A\n'
|
||||||
' * TEST_1\n'
|
' * TEST_1\n'
|
||||||
'2. TEST_B\n'
|
'2. TEST_B\n'
|
||||||
' * TEST_2\n'))
|
' * TEST_2'))
|
||||||
|
|
||||||
def test_command_exceptions(self) -> None:
|
def test_command_exceptions(self) -> None:
|
||||||
"""Add appropriate tests here for all additional commands with try/except blocks.
|
"""Add appropriate tests here for all additional commands with try/except blocks.
|
||||||
|
|
|
@ -100,7 +100,7 @@ class TrelloHandler(object):
|
||||||
board_data = board_desc_response.json()
|
board_data = board_desc_response.json()
|
||||||
bot_response += ['{_count}.[{name}]({url}) (`{id}`)'.format(_count=index + 1, **board_data)]
|
bot_response += ['{_count}.[{name}]({url}) (`{id}`)'.format(_count=index + 1, **board_data)]
|
||||||
|
|
||||||
return '\n'.join(bot_response + [''])
|
return '\n'.join(bot_response)
|
||||||
|
|
||||||
def get_all_cards(self, content: List[str]) -> str:
|
def get_all_cards(self, content: List[str]) -> str:
|
||||||
if len(content) != 2:
|
if len(content) != 2:
|
||||||
|
@ -119,7 +119,7 @@ class TrelloHandler(object):
|
||||||
except (KeyError, ValueError, TypeError):
|
except (KeyError, ValueError, TypeError):
|
||||||
return RESPONSE_ERROR_MESSAGE
|
return RESPONSE_ERROR_MESSAGE
|
||||||
|
|
||||||
return '\n'.join(bot_response + [''])
|
return '\n'.join(bot_response)
|
||||||
|
|
||||||
def get_all_checklists(self, content: List[str]) -> str:
|
def get_all_checklists(self, content: List[str]) -> str:
|
||||||
if len(content) != 2:
|
if len(content) != 2:
|
||||||
|
@ -142,7 +142,7 @@ class TrelloHandler(object):
|
||||||
except (KeyError, ValueError, TypeError):
|
except (KeyError, ValueError, TypeError):
|
||||||
return RESPONSE_ERROR_MESSAGE
|
return RESPONSE_ERROR_MESSAGE
|
||||||
|
|
||||||
return '\n'.join(bot_response + [''])
|
return '\n'.join(bot_response)
|
||||||
|
|
||||||
def get_all_lists(self, content: List[str]) -> str:
|
def get_all_lists(self, content: List[str]) -> str:
|
||||||
if len(content) != 2:
|
if len(content) != 2:
|
||||||
|
@ -166,6 +166,6 @@ class TrelloHandler(object):
|
||||||
except (KeyError, ValueError, TypeError):
|
except (KeyError, ValueError, TypeError):
|
||||||
return RESPONSE_ERROR_MESSAGE
|
return RESPONSE_ERROR_MESSAGE
|
||||||
|
|
||||||
return '\n'.join(bot_response + [''])
|
return '\n'.join(bot_response)
|
||||||
|
|
||||||
handler_class = TrelloHandler
|
handler_class = TrelloHandler
|
||||||
|
|
Loading…
Reference in a new issue