Skip to content

Commit

Permalink
Fix a couple of failing tests (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
mooster531 authored Dec 17, 2024
1 parent a02b784 commit 0c91d16
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions tests/unit/destinations_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,15 @@ def test_ensure_index_disabled_when_uploading(self, mock_to_csv, *_):
]
dummy_df = pd.DataFrame(dummy_data)
destination = DuneDestination(
api_key=os.getenv("DUNE_API_KEY"), table_name="foo"
api_key=os.getenv("DUNE_API_KEY"),
table_name="foo",
request_timeout=10,
)
destination.save(dummy_df)
mock_to_csv.assert_called_once_with(index=False)

@patch("pandas.core.generic.NDFrame.to_csv", name="Fake csv writer")
def test_duneclient_sets_timeout(self, mock_to_csv, *_):
dummy_data = [
{"foo": "bar"},
{"baz": "daz"},
]
dummy_df = pd.DataFrame(dummy_data)
for timeout in [1, 10, 100, 1000, 1500]:
destination = DuneDestination(
api_key=os.getenv("DUNE_API_KEY"),
Expand All @@ -57,7 +54,7 @@ def test_duneclient_sets_timeout(self, mock_to_csv, *_):

@patch("dune_client.api.table.TableAPI.upload_csv", name="Fake CSV uploader")
def test_dune_error_handling(self, mock_dune_upload_csv):
dest = DuneDestination(api_key="f00b4r", table_name="foo")
dest = DuneDestination(api_key="f00b4r", table_name="foo", request_timeout=10)
df = pd.DataFrame([{"foo": "bar"}])

dune_err = DuneError(
Expand Down

0 comments on commit 0c91d16

Please sign in to comment.