Skip to content

Commit 2b6926d

Browse files
Source Chargebee: run format and correct unit test (#10811)
* feat(chargebee) add credit note model * fix(airbyte): update version Dockerfile * fix(airbyte): update version Dockerfile v2 * correct unit test Co-authored-by: Koen Sengers <[email protected]>
1 parent 16dfae0 commit 2b6926d

File tree

3 files changed

+31
-4
lines changed

3 files changed

+31
-4
lines changed

airbyte-integrations/connectors/source-chargebee/source_chargebee/source.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,21 @@
99
from airbyte_cdk.sources import AbstractSource
1010
from airbyte_cdk.sources.streams import Stream
1111

12-
from .streams import Addon, AttachedItem, Coupon, CreditNote, Customer, Event, Invoice, Item, ItemPrice, Order, Plan, Subscription, Transaction
12+
from .streams import (
13+
Addon,
14+
AttachedItem,
15+
Coupon,
16+
CreditNote,
17+
Customer,
18+
Event,
19+
Invoice,
20+
Item,
21+
ItemPrice,
22+
Order,
23+
Plan,
24+
Subscription,
25+
Transaction,
26+
)
1327

1428

1529
class SourceChargebee(AbstractSource):

airbyte-integrations/connectors/source-chargebee/source_chargebee/streams.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ def request_params(self, **kwargs) -> MutableMapping[str, Any]:
321321
params["sort_by[asc]"] = "created_at"
322322
return params
323323

324+
324325
class CreditNote(IncrementalChargebeeStream):
325326
"""
326327
API docs: https://apidocs.chargebee.com/docs/api/credit_notes?prod_cat_ver=2#list_credit_notes

airbyte-integrations/connectors/source-chargebee/unit_tests/test_source.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,20 +85,32 @@ def test_check_error_v2(test_config_v2):
8585
def test_source_streams_v1(test_config_v1):
8686
source = SourceChargebee()
8787
streams = source.streams(test_config_v1)
88-
assert len(streams) == 9
88+
assert len(streams) == 10
8989
actual_stream_names = {stream.name for stream in streams}
90-
expected_stream_names = {"coupon", "customer", "event", "invoice", "order", "subscription", "addon", "plan", "transaction"}
90+
expected_stream_names = {
91+
"coupon",
92+
"credit_note",
93+
"customer",
94+
"event",
95+
"invoice",
96+
"order",
97+
"subscription",
98+
"addon",
99+
"plan",
100+
"transaction",
101+
}
91102
assert expected_stream_names == actual_stream_names
92103

93104

94105
@responses.activate
95106
def test_source_streams_v2(test_config_v2):
96107
source = SourceChargebee()
97108
streams = source.streams(test_config_v2)
98-
assert len(streams) == 10
109+
assert len(streams) == 11
99110
actual_stream_names = {stream.name for stream in streams}
100111
expected_stream_names = {
101112
"coupon",
113+
"credit_note",
102114
"customer",
103115
"event",
104116
"invoice",

0 commit comments

Comments
 (0)