Skip to content

Commit c39a7c4

Browse files
authored
🎉Source Harvest: increase unit test coverage at least 90% (#15220)
* Increased unit test coverage * Increased unit test * Updated to linter
1 parent 9751c16 commit c39a7c4

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

airbyte-integrations/connectors/source-amazon-ads/integration_tests/configured_catalog_report.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55
"name": "sponsored_products_report_stream",
66
"json_schema": {},
77
"supported_sync_modes": ["full_refresh", "incremental"],
8-
"source_defined_primary_key": [["profileId"], ["recordType"], ["reportDate"], ["updatedAt"]]
8+
"source_defined_primary_key": [
9+
["profileId"],
10+
["recordType"],
11+
["reportDate"],
12+
["updatedAt"]
13+
]
914
},
1015
"sync_mode": "incremental",
1116
"destination_sync_mode": "overwrite"

airbyte-integrations/connectors/source-harvest/unit_tests/conftest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
def config_fixture(requests_mock):
1111
url = "https://id.getharvest.com/api/v2/oauth2/token"
1212
requests_mock.get(url, json={})
13-
1413
config = {"account_id": "ID", "replication_start_date": "2021-01-01T21:20:07Z", "credentials": {"api_token": "TOKEN"}}
1514

1615
return config

airbyte-integrations/connectors/source-harvest/unit_tests/unit_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ def test_report_base_stream(config, from_date, mock_stream):
7777
mock_stream("reports/expenses/clients", response={"results": [{"client_id": 1}]})
7878

7979
invoice_payments_instance = ExpensesClients(authenticator=NoAuth(), from_date=from_date)
80-
invoice_payments = invoice_payments_instance.read_records(sync_mode=None)
80+
stream_slice = next(invoice_payments_instance.stream_slices(sync_mode=None))
81+
invoice_payments = invoice_payments_instance.read_records(sync_mode=None, stream_slice=stream_slice)
8182

8283
assert next(invoice_payments)

0 commit comments

Comments
 (0)