Skip to content

Commit 8f2554e

Browse files
committed
Split unit test to two
1 parent 9e6134d commit 8f2554e

File tree

1 file changed

+22
-15
lines changed

1 file changed

+22
-15
lines changed

unit_tests/sources/declarative/test_state_delegating_stream.py

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def get_records(
187187

188188

189189
@freezegun.freeze_time("2024-07-15")
190-
def test_state_retriever():
190+
def test_full_refresh_retriever():
191191
with HttpMocker() as http_mocker:
192192
http_mocker.get(
193193
HttpRequest(url="https://api.test.com/items"),
@@ -200,19 +200,6 @@ def test_state_retriever():
200200
)
201201
),
202202
)
203-
http_mocker.get(
204-
HttpRequest(
205-
url="https://api.test.com/items_with_filtration?start=2024-07-13&end=2024-07-15"
206-
),
207-
HttpResponse(
208-
body=json.dumps(
209-
[
210-
{"id": 3, "name": "item_3", "updated_at": "2024-02-01"},
211-
{"id": 4, "name": "item_4", "updated_at": "2024-02-01"},
212-
]
213-
)
214-
),
215-
)
216203

217204
source = ConcurrentDeclarativeSource(
218205
source_config=_MANIFEST, config=_CONFIG, catalog=None, state=None
@@ -227,7 +214,24 @@ def test_state_retriever():
227214
]
228215
assert expected_full == full_records
229216

230-
# Test incremental data retrieval (with state)
217+
218+
@freezegun.freeze_time("2024-07-15")
219+
def test_incremental_retriever():
220+
with HttpMocker() as http_mocker:
221+
http_mocker.get(
222+
HttpRequest(
223+
url="https://api.test.com/items_with_filtration?start=2024-07-13&end=2024-07-15"
224+
),
225+
HttpResponse(
226+
body=json.dumps(
227+
[
228+
{"id": 3, "name": "item_3", "updated_at": "2024-02-01"},
229+
{"id": 4, "name": "item_4", "updated_at": "2024-02-01"},
230+
]
231+
)
232+
),
233+
)
234+
231235
state = [
232236
AirbyteStateMessage(
233237
type=AirbyteStateType.STREAM,
@@ -240,6 +244,9 @@ def test_state_retriever():
240244
source = ConcurrentDeclarativeSource(
241245
source_config=_MANIFEST, config=_CONFIG, catalog=None, state=state
242246
)
247+
configured_catalog = create_configured_catalog(source, _CONFIG)
248+
249+
# Test incremental data retrieval (with state)
243250
incremental_records = get_records(source, _CONFIG, configured_catalog, state)
244251
expected_incremental = [
245252
{"id": 3, "name": "item_3", "updated_at": "2024-02-01"},

0 commit comments

Comments
 (0)