diff --git a/zulip_bots/zulip_bots/bots/baremetrics/fixtures/list_plans.json b/zulip_bots/zulip_bots/bots/baremetrics/fixtures/list_plans.json index 68bc536..3dc7220 100644 --- a/zulip_bots/zulip_bots/bots/baremetrics/fixtures/list_plans.json +++ b/zulip_bots/zulip_bots/bots/baremetrics/fixtures/list_plans.json @@ -6,14 +6,50 @@ } }, "response": { - "plans": [], - "meta": { - "pagination": { - "has_more": false, - "page": 0, - "per_page": 30 + "plans": [ + { + "oid": "plan_1", + "source_id": "123", + "source": "baremetrics", + "name": "Plan 1", + "interval": "year", + "interval_count": 1, + "trial_duration": null, + "trial_duration_unit": null, + "created": null, + "active": true, + "setup_fees": 0, + "amounts": [ + { + "currency": "USD", + "symbol": "$", + "symbol_right": false, + "amount": 450000 + } + ] + }, + { + "oid": "plan_2", + "source_id": "123", + "source": "baremetrics", + "name": "Plan 2", + "interval": "year", + "interval_count": 1, + "trial_duration": null, + "trial_duration_unit": null, + "created": null, + "active": true, + "setup_fees": 0, + "amounts": [ + { + "currency": "USD", + "symbol": "$", + "symbol_right": false, + "amount": 450000 + } + ] } - } + ] }, "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 b71fa55..c178dfb 100644 --- a/zulip_bots/zulip_bots/bots/baremetrics/test_baremetrics.py +++ b/zulip_bots/zulip_bots/bots/baremetrics/test_baremetrics.py @@ -38,9 +38,13 @@ class TestBaremetricsBot(BotTestCase): 'baremetrics\nProvider ID: None\n\n') 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' + with self.mock_config_info({'api_key': 'TEST'}): with self.mock_http_conversation('list_plans'): - self.verify_reply('list-plans TEST', '**Listing plans:** \n') + self.verify_reply('list-plans TEST', r) def test_list_customers_command(self) -> None: with self.mock_config_info({'api_key': 'TEST'}):