Skip to content

Commit

Permalink
Adjust tests
Browse files Browse the repository at this point in the history
  • Loading branch information
BernardWez committed Nov 21, 2023
1 parent 97da5cc commit de7ce2f
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions tests/test_elx/test_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,18 +158,20 @@ def test_catalog_replication_method(tap_incremental: Tap):
"""If we have an incremental stream, the replication_method in the catalog should be `INCREMENTAL`."""
catalog_dict = tap_incremental.catalog.dict(by_alias=True)

replication_method = INCREMENTAL_CATALOG["streams"][0]["replication_method"]
assert replication_method == "INCREMENTAL"
assert catalog_dict["streams"][0]["replication_method"] == "INCREMENTAL"
assert (
catalog_dict["streams"][0]["replication_method"]
== INCREMENTAL_CATALOG["streams"][0]["replication_method"]
)


def test_catalog_replication_key(tap_incremental: Tap):
"""If we have an incremental stream, the catalog should have a `replication_key`."""
catalog_dict = tap_incremental.catalog.dict(by_alias=True)

replication_key = INCREMENTAL_CATALOG["streams"][0]["replication_key"]
assert replication_key == "updated_at"
assert catalog_dict["streams"][0]["replication_key"] == replication_key
assert (
catalog_dict["streams"][0]["replication_key"]
== INCREMENTAL_CATALOG["streams"][0]["replication_key"]
)


def test_catalog_valid_replication_keys(tap_incremental: Tap):
Expand All @@ -194,8 +196,5 @@ def test_catalog_valid_replication_keys(tap_incremental: Tap):
"valid-replication-keys", None
)

# Checks that the `valid-replication-keys` key exists
assert replication_keys != None

# Checks that value of `valid-replication-keys` equals to the replication-key
assert replication_keys == ["updated_at"]
assert replication_keys == [INCREMENTAL_CATALOG["streams"][0]["replication_key"]]

0 comments on commit de7ce2f

Please sign in to comment.