Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
maximearmstrong committed Nov 26, 2024
1 parent 5eaf246 commit 9161976
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
},
}


# Taken from Fivetran API documentation
# https://fivetran.com/docs/rest-api/api-reference/connectors/connector-details
# The sample is parameterized to test the poll method
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def test_basic_resource_request(

# Timed out poll
all_api_mocks.calls.reset()
with pytest.raises(Failure) as e:
with pytest.raises(Failure, match=f"Sync for connector '{connector_id}' timed out"):
client.poll_sync(
connector_id=connector_id,
# The poll process will time out because the value of
Expand All @@ -89,7 +89,6 @@ def test_basic_resource_request(
poll_timeout=2,
poll_interval=1,
)
assert f"Sync for connector '{connector_id}' timed out" in str(e.value)

# Failed poll
all_api_mocks.calls.reset()
Expand All @@ -102,11 +101,10 @@ def test_basic_resource_request(
),
status=200,
)
with pytest.raises(Failure) as e:
with pytest.raises(Failure, match=f"Sync for connector '{connector_id}' failed!"):
client.poll_sync(
connector_id=connector_id,
previous_sync_completed_at=parser.parse(MIN_TIME_STR),
poll_timeout=2,
poll_interval=1,
)
assert f"Sync for connector '{connector_id}' failed!" in str(e.value)

0 comments on commit 9161976

Please sign in to comment.