-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 Source Chargebee: add tests + fix broken
coupon
stream (#10366)
* 10192 Fix Chargebee source Fix `coupon` stream. Add unit tests. * 10192 Update tests + update docs * 10192 Bump connector's version
- Loading branch information
Showing
25 changed files
with
2,771 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
airbyte-integrations/connectors/source-chargebee/unit_tests/conftest.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# | ||
# Copyright (c) 2021 Airbyte, Inc., all rights reserved. | ||
# | ||
|
||
import json | ||
import os | ||
|
||
from pytest import fixture | ||
|
||
|
||
def load_file(fn): | ||
return open(os.path.join("unit_tests", "responses", fn)).read() | ||
|
||
|
||
@fixture | ||
def test_config_v1(): | ||
return {"site": "airbyte-test", "site_api_key": "site_api_key", "start_date": "2021-05-22T06:57:44Z", "product_catalog": "1.0"} | ||
|
||
|
||
@fixture | ||
def test_config_v2(): | ||
return {"site": "airbyte-test", "site_api_key": "site_api_key", "start_date": "2021-05-22T06:57:44Z", "product_catalog": "2.0"} | ||
|
||
|
||
@fixture | ||
def addons_response(): | ||
return json.loads(load_file("addons.json")) | ||
|
||
|
||
@fixture | ||
def plans_response(): | ||
return json.loads(load_file("plans.json")) | ||
|
||
|
||
@fixture | ||
def coupons_response(): | ||
return json.loads(load_file("coupons.json")) | ||
|
||
|
||
@fixture | ||
def customers_response(): | ||
return json.loads(load_file("customers.json")) | ||
|
||
|
||
@fixture | ||
def invoices_response(): | ||
return json.loads(load_file("invoices.json")) | ||
|
||
|
||
@fixture | ||
def orders_response(): | ||
return json.loads(load_file("orders.json")) | ||
|
||
|
||
@fixture | ||
def events_response(): | ||
return json.loads(load_file("events.json")) | ||
|
||
|
||
@fixture | ||
def subscriptions_response(): | ||
return json.loads(load_file("subscriptions.json")) | ||
|
||
|
||
@fixture | ||
def items_response(): | ||
return json.loads(load_file("items.json")) | ||
|
||
|
||
@fixture | ||
def item_prices_response(): | ||
return json.loads(load_file("item_prices.json")) | ||
|
||
|
||
@fixture | ||
def attached_items_response(): | ||
return json.loads(load_file("attached_items.json")) |
79 changes: 79 additions & 0 deletions
79
airbyte-integrations/connectors/source-chargebee/unit_tests/responses/addons.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
{ | ||
"list": [ | ||
{ | ||
"addon": { | ||
"id": "LAMBHEART", | ||
"name": "Lamb Hearts", | ||
"invoice_name": "Lamb Hearts", | ||
"charge_type": "non_recurring", | ||
"price": 850, | ||
"period_unit": "not_applicable", | ||
"status": "active", | ||
"enabled_in_portal": false, | ||
"object": "addon", | ||
"taxable": true, | ||
"type": "quantity" | ||
} | ||
}, | ||
{ | ||
"addon": { | ||
"id": "LAMBHEART-estimate", | ||
"name": "Lamb Hearts Estimate", | ||
"invoice_name": "Lamb Hearts Estimate", | ||
"charge_type": "non_recurring", | ||
"price": 1700, | ||
"period_unit": "not_applicable", | ||
"status": "active", | ||
"enabled_in_portal": false, | ||
"object": "addon", | ||
"taxable": false, | ||
"type": "quantity" | ||
} | ||
}, | ||
{ | ||
"addon": { | ||
"id": "LAMBHEART-TEST", | ||
"name": "Lamb Hearts TEST", | ||
"invoice_name": "Lamb Hearts TEST", | ||
"charge_type": "non_recurring", | ||
"price": 850, | ||
"period_unit": "not_applicable", | ||
"status": "active", | ||
"enabled_in_portal": false, | ||
"object": "addon", | ||
"taxable": true, | ||
"type": "quantity" | ||
} | ||
}, | ||
{ | ||
"addon": { | ||
"id": "LAMBHEART-TEST-estimate", | ||
"name": "Lamb Hearts TEST Estimate", | ||
"invoice_name": "Lamb Hearts TEST Estimate", | ||
"charge_type": "non_recurring", | ||
"price": 1700, | ||
"period_unit": "not_applicable", | ||
"status": "active", | ||
"enabled_in_portal": false, | ||
"object": "addon", | ||
"taxable": false, | ||
"type": "quantity" | ||
} | ||
}, | ||
{ | ||
"addon": { | ||
"id": "CHOMPERY-BEEFJERKY-estimate", | ||
"name": "Chompery Beef Jerky Estimate", | ||
"invoice_name": "Chompery Beef Jerky Estimate", | ||
"charge_type": "non_recurring", | ||
"price": 2400, | ||
"period_unit": "not_applicable", | ||
"status": "active", | ||
"enabled_in_portal": true, | ||
"object": "addon", | ||
"taxable": true, | ||
"type": "quantity" | ||
} | ||
} | ||
] | ||
} |
Oops, something went wrong.