From 5c41aa88095a12a81a96acbc2b09f9a90ba699a0 Mon Sep 17 00:00:00 2001 From: BernardWez Date: Thu, 23 Nov 2023 17:25:44 +0100 Subject: [PATCH] Add test for setting replication key --- tests/test_elx/test_catalog.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/test_elx/test_catalog.py b/tests/test_elx/test_catalog.py index 90e3792..a0ef4d0 100644 --- a/tests/test_elx/test_catalog.py +++ b/tests/test_elx/test_catalog.py @@ -178,3 +178,11 @@ def test_catalog_valid_replication_keys(tap: Tap): # Checks that value of `valid-replication-keys` equals to the replication-key assert replication_keys == [DEFAULT_CATALOG["streams"][1]["replication_key"]] + + +def test_catalog_set_stream_replication_key(tap: Tap): + """If we define a replication key, the catalog should be updated.""" + catalog = tap.catalog + + assert catalog.streams[1].replication_method == "INCREMENTAL" + assert catalog.streams[1].replication_key == "updated_at"