Skip to content

Commit

Permalink
Source Chargebee: run format and correct unit test (#10811)
Browse files Browse the repository at this point in the history
* 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 <k.sengers@gynzy.com>
  • Loading branch information
2 people authored and etsybaev committed Mar 5, 2022
1 parent b2d097a commit d6d210b
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,21 @@
from airbyte_cdk.sources import AbstractSource
from airbyte_cdk.sources.streams import Stream

from .streams import Addon, AttachedItem, Coupon, CreditNote, Customer, Event, Invoice, Item, ItemPrice, Order, Plan, Subscription, Transaction
from .streams import (
Addon,
AttachedItem,
Coupon,
CreditNote,
Customer,
Event,
Invoice,
Item,
ItemPrice,
Order,
Plan,
Subscription,
Transaction,
)


class SourceChargebee(AbstractSource):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ def request_params(self, **kwargs) -> MutableMapping[str, Any]:
params["sort_by[asc]"] = "created_at"
return params


class CreditNote(IncrementalChargebeeStream):
"""
API docs: https://apidocs.chargebee.com/docs/api/credit_notes?prod_cat_ver=2#list_credit_notes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,20 +85,32 @@ def test_check_error_v2(test_config_v2):
def test_source_streams_v1(test_config_v1):
source = SourceChargebee()
streams = source.streams(test_config_v1)
assert len(streams) == 9
assert len(streams) == 10
actual_stream_names = {stream.name for stream in streams}
expected_stream_names = {"coupon", "customer", "event", "invoice", "order", "subscription", "addon", "plan", "transaction"}
expected_stream_names = {
"coupon",
"credit_note",
"customer",
"event",
"invoice",
"order",
"subscription",
"addon",
"plan",
"transaction",
}
assert expected_stream_names == actual_stream_names


@responses.activate
def test_source_streams_v2(test_config_v2):
source = SourceChargebee()
streams = source.streams(test_config_v2)
assert len(streams) == 10
assert len(streams) == 11
actual_stream_names = {stream.name for stream in streams}
expected_stream_names = {
"coupon",
"credit_note",
"customer",
"event",
"invoice",
Expand Down

0 comments on commit d6d210b

Please sign in to comment.