8
8
import responses
9
9
from airbyte_cdk .models import SyncMode
10
10
from pytest import fixture
11
- from source_orb .source import CreditsLedgerEntries , Customers , IncrementalOrbStream , OrbStream , Subscriptions , SubscriptionUsage , Plans
11
+ from source_orb .source import CreditsLedgerEntries , Customers , IncrementalOrbStream , OrbStream , Plans , Subscriptions , SubscriptionUsage
12
12
13
13
14
14
@fixture
@@ -326,7 +326,7 @@ def test_subscription_usage_stream_slices(mocker):
326
326
Subscriptions , "read_records" , return_value = iter ([
327
327
{"id" : "1" , "plan_id" : "2" },
328
328
{"id" : "11" , "plan_id" : "2" },
329
- {"id" : "111" , "plan_id" : "3" } # should be ignored because plan_id set to 2
329
+ {"id" : "111" , "plan_id" : "3" } # should be ignored because plan_id set to 2
330
330
])
331
331
)
332
332
stream = SubscriptionUsage (plan_id = "2" , start_date = "2022-01-25T12:00:00+00:00" , end_date = "2022-01-26T12:00:00+00:00" )
@@ -343,7 +343,7 @@ def test_subscription_usage_stream_slices_with_grouping_key(mocker):
343
343
Subscriptions , "read_records" , return_value = iter ([
344
344
{"id" : "1" , "plan_id" : "2" },
345
345
{"id" : "11" , "plan_id" : "2" },
346
- {"id" : "111" , "plan_id" : "3" } # should be ignored because plan_id set to 2
346
+ {"id" : "111" , "plan_id" : "3" } # should be ignored because plan_id set to 2
347
347
])
348
348
)
349
349
@@ -353,7 +353,7 @@ def test_subscription_usage_stream_slices_with_grouping_key(mocker):
353
353
{"billable_metric" : {"id" : "billableMetricIdA" }},
354
354
{"billable_metric" : {"id" : "billableMetricIdB" }}
355
355
]},
356
- {"id" : "3" , "prices" : [ # should be ignored because plan_id is set to 2
356
+ {"id" : "3" , "prices" : [ # should be ignored because plan_id is set to 2
357
357
{"billable_metric" : {"id" : "billableMetricIdC" }}
358
358
]}
359
359
])
@@ -374,7 +374,6 @@ def test_subscription_usage_stream_slices_with_grouping_key(mocker):
374
374
assert list (stream .stream_slices (** inputs )) == expected_stream_slice
375
375
376
376
377
-
378
377
@pytest .mark .parametrize (
379
378
("current_stream_state" , "current_stream_slice" , "grouping_key" ),
380
379
[
@@ -499,6 +498,7 @@ def test_subscription_usage_yield_transformed_subrecords(mocker):
499
498
500
499
assert actual_output == expected
501
500
501
+
502
502
def test_subscription_usage_yield_transformed_subrecords_with_grouping (mocker ):
503
503
stream = SubscriptionUsage (start_date = "2022-01-25T12:00:00+00:00" , end_date = "2022-01-26T12:00:00+00:00" , subscription_usage_grouping_key = "grouping_key" )
504
504
@@ -567,6 +567,7 @@ def test_subscription_usage_yield_transformed_subrecords_with_grouping(mocker):
567
567
568
568
assert actual_output == expected
569
569
570
+
570
571
def test_supports_incremental (patch_incremental_base_class , mocker ):
571
572
mocker .patch .object (IncrementalOrbStream , "cursor_field" , "dummy_field" )
572
573
stream = IncrementalOrbStream ()
0 commit comments