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

This commit is contained in:
neiljp (Neil Pilgrim) 2018-05-27 22:38:39 -07:00 committed by showell
parent b51b6d0361
commit 8e1d4f524b
2 changed files with 18 additions and 18 deletions

View file

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

View file

@ -51,7 +51,7 @@ class TestBaremetricsBot(BotTestCase):
def test_list_plans_command(self) -> None: def test_list_plans_command(self) -> None:
r = '**Listing plans:**\n1.Name: Plan 1\nActive: True\nInterval: year\nInterval Count: 1\nAmounts:\n' \ 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\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_config_info({'api_key': 'TEST'}):
with self.mock_http_conversation('list_plans'): with self.mock_http_conversation('list_plans'):
@ -59,7 +59,7 @@ class TestBaremetricsBot(BotTestCase):
def test_list_customers_command(self) -> None: def test_list_customers_command(self) -> None:
r = '**Listing customers:**\n1.Name: Customer 1\nDisplay Name: Customer 1\nOID: customer_1\nActive: True\n' \ 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_config_info({'api_key': 'TEST'}):
with self.mock_http_conversation('list_customers'): with self.mock_http_conversation('list_customers'):
@ -68,7 +68,7 @@ class TestBaremetricsBot(BotTestCase):
def test_list_subscriptions_command(self) -> None: def test_list_subscriptions_command(self) -> None:
r = '**Listing subscriptions:**\n1.Customer Name: Customer 1\nCustomer Display Name: Customer 1\n' \ 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' \ '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_config_info({'api_key': 'TEST'}):
with self.mock_http_conversation('list_subscriptions'): with self.mock_http_conversation('list_subscriptions'):