diff --git a/zulip_bots/zulip_bots/bots/baremetrics/fixtures/list_subscriptions.json b/zulip_bots/zulip_bots/bots/baremetrics/fixtures/list_subscriptions.json index 0cd1e67..9a123ab 100644 --- a/zulip_bots/zulip_bots/bots/baremetrics/fixtures/list_subscriptions.json +++ b/zulip_bots/zulip_bots/bots/baremetrics/fixtures/list_subscriptions.json @@ -6,14 +6,52 @@ } }, "response": { - "subscriptions": [], - "meta": { - "pagination": { - "has_more": false, - "page": 0, - "per_page": 30 + "subscriptions": [ + { + "oid": "subscription_1", + "source_id": "source_1", + "source": "stripe", + "customer": { + "oid": "customer_1", + "source_id": "source_1", + "source": "stripe", + "created": 1492605754, + "email": "customer_1@baremetrics.com", + "name": "Customer 1", + "display_image": "https://logo.clearbit.com/baremetrics.com", + "display_name": "Customer 1", + "notes": "Here are some notes", + "ltv": 50000 + }, + "canceled_at": null, + "started_at": 1492605754, + "processed": true, + "active": true, + "quantity": 1, + "discount": 0, + "plan": { + "oid": "plan_1", + "source_id": "source_1", + "source": "stripe", + "name": "Plan 1", + "interval": "month", + "interval_count": 1, + "trial_duration": null, + "trial_duration_unit": null, + "created": 1492605754, + "active": true, + "setup_fees": 0, + "amounts": [ + { + "currency": "USD", + "symbol": "$", + "symbol_right": false, + "amount": 1000 + } + ] + } } - } + ] }, "response-headers": { "X-TokenExpires": "0", diff --git a/zulip_bots/zulip_bots/bots/baremetrics/test_baremetrics.py b/zulip_bots/zulip_bots/bots/baremetrics/test_baremetrics.py index 879a423..cd0b0e4 100644 --- a/zulip_bots/zulip_bots/bots/baremetrics/test_baremetrics.py +++ b/zulip_bots/zulip_bots/bots/baremetrics/test_baremetrics.py @@ -55,6 +55,10 @@ class TestBaremetricsBot(BotTestCase): self.verify_reply('list-customers TEST', r) 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' + with self.mock_config_info({'api_key': 'TEST'}): with self.mock_http_conversation('list_subscriptions'): - self.verify_reply('list-subscriptions TEST', '**Listing subscriptions:** \n') + self.verify_reply('list-subscriptions TEST', r)