baremetrics: Remove extra newlines & spaces in code and tests.
MODIFY
zulip_bots/zulip_bots/bots/baremetrics/baremetrics.py
zulip_bots/zulip_bots/bots/baremetrics/baremetrics.py
@@ -152,7 +152,7 @@ class BaremetricsHandler(object):
for amount in plan['amounts']] +
[''])
- return '\n'.join(response + [''])
+ return '\n'.join(response)
def get_customers(self, source_id: str) -> str:
url = 'https://api.baremetrics.com/v1/{}/customers'.format(source_id)
@@ -176,7 +176,7 @@ class BaremetricsHandler(object):
for plan in customer['current_plans']] +
[''])
- return '\n'.join(response + [''])
+ return '\n'.join(response)
def get_subscriptions(self, source_id: str) -> str:
url = 'https://api.baremetrics.com/v1/{}/subscriptions'.format(source_id)
@@ -202,7 +202,7 @@ class BaremetricsHandler(object):
for amount in subscription['plan']['amounts']] +
[''])
- return '\n'.join(response + [''])
+ return '\n'.join(response)
def create_plan(self, parameters: List[str]) -> str:
data_header = {

MODIFY
zulip_bots/zulip_bots/bots/baremetrics/test_baremetrics.py
zulip_bots/zulip_bots/bots/baremetrics/test_baremetrics.py
@@ -51,7 +51,7 @@ class TestBaremetricsBot(BotTestCase):
def test_list_plans_command(self) -> None:
r = '**Listing plans:**\n1.Name: Plan 1\nActive: True\nInterval: year\nInterval Count: 1\nAmounts:\n' \
' - 450000 USD\n\n2.Name: Plan 2\nActive: True\nInterval: year\nInterval Count: 1\nAmounts:\n' \
- ' - 450000 USD\n\n'
+ ' - 450000 USD\n'
with self.mock_config_info({'api_key': 'TEST'}):
with self.mock_http_conversation('list_plans'):
@@ -59,7 +59,7 @@ class TestBaremetricsBot(BotTestCase):
def test_list_customers_command(self) -> None:
r = '**Listing customers:**\n1.Name: Customer 1\nDisplay Name: Customer 1\nOID: customer_1\nActive: True\n' \
- 'Email: customer_1@baremetrics.com\nNotes: Here are some notes\nCurrent Plans: \n - Plan 1\n\n'
+ 'Email: customer_1@baremetrics.com\nNotes: Here are some notes\nCurrent Plans:\n - Plan 1\n'
with self.mock_config_info({'api_key': 'TEST'}):
with self.mock_http_conversation('list_customers'):
@@ -68,7 +68,7 @@ class TestBaremetricsBot(BotTestCase):
def test_list_subscriptions_command(self) -> None:
r = '**Listing subscriptions:**\n1.Customer Name: Customer 1\nCustomer Display Name: Customer 1\n' \
'Customer OID: customer_1\nCustomer Email: customer_1@baremetrics.com\nActive: True\n' \
- 'Plan Name: Plan 1\nPlan Amounts: \n - 1000 $\n\n'
+ 'Plan Name: Plan 1\nPlan Amounts:\n - 1000 $\n'
with self.mock_config_info({'api_key': 'TEST'}):
with self.mock_http_conversation('list_subscriptions'):

baremetrics: Remove extra newlines & spaces in code and tests.