Skip to content

Commit 76b529c

Browse files
committed
fix integration tests
1 parent 3c0754d commit 76b529c

File tree

3 files changed

+65
-5
lines changed

3 files changed

+65
-5
lines changed

airbyte-integrations/connectors/source-facebook-marketing/integration_tests/configured_catalog.json

+60
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,65 @@
11
{
22
"streams": [
3+
{
4+
"stream": {
5+
"name": "campaigns",
6+
"json_schema": {},
7+
"supported_sync_modes": ["full_refresh", "incremental"],
8+
"source_defined_cursor": true,
9+
"default_cursor_field": ["updated_time"],
10+
"source_defined_primary_key": [["id"]],
11+
"namespace": null
12+
},
13+
"sync_mode": "incremental",
14+
"cursor_field": null,
15+
"destination_sync_mode": "append",
16+
"primary_key": null
17+
},
18+
{
19+
"stream": {
20+
"name": "ad_sets",
21+
"json_schema": {},
22+
"supported_sync_modes": ["full_refresh", "incremental"],
23+
"source_defined_cursor": true,
24+
"default_cursor_field": ["updated_time"],
25+
"source_defined_primary_key": [["id"]],
26+
"namespace": null
27+
},
28+
"sync_mode": "incremental",
29+
"cursor_field": null,
30+
"destination_sync_mode": "append",
31+
"primary_key": null
32+
},
33+
{
34+
"stream": {
35+
"name": "ads",
36+
"json_schema": {},
37+
"supported_sync_modes": ["full_refresh", "incremental"],
38+
"source_defined_cursor": true,
39+
"default_cursor_field": ["updated_time"],
40+
"source_defined_primary_key": [["id"]],
41+
"namespace": null
42+
},
43+
"sync_mode": "incremental",
44+
"cursor_field": null,
45+
"destination_sync_mode": "append",
46+
"primary_key": null
47+
},
48+
{
49+
"stream": {
50+
"name": "ad_creatives",
51+
"json_schema": {},
52+
"supported_sync_modes": ["full_refresh"],
53+
"source_defined_cursor": null,
54+
"default_cursor_field": null,
55+
"source_defined_primary_key": [["id"]],
56+
"namespace": null
57+
},
58+
"sync_mode": "full_refresh",
59+
"cursor_field": null,
60+
"destination_sync_mode": "append",
61+
"primary_key": null
62+
},
363
{
464
"stream": {
565
"name": "ads_insights",

airbyte-integrations/connectors/source-facebook-marketing/integration_tests/test_streams.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def test_streams_with_include_deleted(self, stream_name, deleted_id, config_with
5252
assert deleted_records, f"{stream_name} stream should have deleted records returned"
5353
assert is_specific_deleted_pulled, f"{stream_name} stream should have a deleted record with id={deleted_id}"
5454

55-
@pytest.mark.parametrize("stream_name, deleted_num", [("ads", 2), ("campaigns", 1), ("ad_sets", 1)])
55+
@pytest.mark.parametrize("stream_name, deleted_num", [("ads", 2), ("campaigns", 3), ("ad_sets", 1)])
5656
def test_streams_with_include_deleted_and_state(self, stream_name, deleted_num, config_with_include_deleted, configured_catalog, state):
5757
"""Should ignore state because of include_deleted enabled"""
5858
catalog = self.slice_catalog(configured_catalog, {stream_name})

airbyte-integrations/connectors/source-facebook-marketing/unit_tests/test_async_job.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import pytest
88
from source_facebook_marketing.api import API
9-
from source_facebook_marketing.streams.async_job import AsyncJob, Status
9+
from source_facebook_marketing.streams.async_job import InsightAsyncJob, Status
1010
from source_facebook_marketing.streams.common import JobException
1111

1212

@@ -23,7 +23,7 @@ def adreport_fixture(mocker):
2323

2424
@pytest.fixture(name="job")
2525
def job_fixture(api, mocker):
26-
return AsyncJob(api=api, params=mocker.MagicMock())
26+
return InsightAsyncJob(api=api, params=mocker.MagicMock())
2727

2828

2929
@pytest.fixture(name="failed_job")
@@ -49,7 +49,7 @@ def api_fixture(mocker, adreport):
4949
return api
5050

5151

52-
class TestAsyncJob:
52+
class TestInsightAsyncJob:
5353
def test_start(self, job):
5454
job.start()
5555

@@ -139,7 +139,7 @@ def test_failed_yes(self, failed_job):
139139
assert failed_job.failed, "should return True if the job previously failed"
140140

141141
def test_str(self, api, adreport):
142-
job = AsyncJob(api=api, params={"time_range": 123, "breakdowns": [10, 20]})
142+
job = InsightAsyncJob(api=api, params={"time_range": 123, "breakdowns": [10, 20]})
143143

144144
assert str(job) == "AdReportRun(id=<None>, time_range=123, breakdowns=[10, 20]"
145145

0 commit comments

Comments
 (0)