Skip to content

Commit

Permalink
Simplify catalog tests
Browse files Browse the repository at this point in the history
  • Loading branch information
BernardWez committed Nov 21, 2023
1 parent 11a7d64 commit fa57c41
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions tests/test_elx/test_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,12 @@ def test_catalog(tap: Tap):
def test_catalog_select(tap: Tap):
"""If we select a stream, the catalog should be updated."""
catalog = tap.catalog.select(["animals"])
catalog_dict = catalog.dict(by_alias=True)

assert catalog_dict["streams"][0]["metadata"][-1]["metadata"]["selected"] == True
assert catalog.streams[0].is_selected == True

catalog = tap.catalog.select([])
catalog_dict = catalog.dict(by_alias=True)

assert catalog_dict["streams"][0]["metadata"][-1]["metadata"]["selected"] == False
assert catalog.streams[0].is_selected == False


def test_catalog_no_deselect(tap: Tap):
Expand All @@ -135,9 +133,8 @@ def test_catalog_no_deselect(tap: Tap):
def test_catalog_deselect_stream(tap: Tap):
"""If we deselect a stream, the catalog should be updated."""
catalog = tap.catalog.deselect(["animals"])
catalog_dict = catalog.dict(by_alias=True)

assert catalog_dict["streams"][0]["metadata"][-1]["metadata"]["selected"] == False
assert catalog.streams[0].is_selected == False


def test_catalog_deselect_invalid_stream(tap: Tap):
Expand Down

0 comments on commit fa57c41

Please sign in to comment.