zulip_bots: Add better test for `list-plans` command of Baremetrics bot.
MODIFY
zulip_bots/zulip_bots/bots/baremetrics/fixtures/list_plans.json
zulip_bots/zulip_bots/bots/baremetrics/fixtures/list_plans.json
}
},
"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",

MODIFY
zulip_bots/zulip_bots/bots/baremetrics/test_baremetrics.py
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'}):

zulip_bots: Add better test for `list-plans` command of Baremetrics bot.