Skip to content

Commit

Permalink
Fix bad merge
Browse files Browse the repository at this point in the history
  • Loading branch information
bh2smith committed Jan 7, 2025
1 parent 4d441c0 commit b38d67e
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tests/unit/destinations_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ def test_duneclient_sets_timeout(self, mock_to_csv, *_):
@patch("dune_client.api.table.TableAPI.create_table", name="Fake Table Creator")
@patch("dune_client.api.table.TableAPI.insert_table", name="Fake Table Inserter")
def test_dune_error_handling(self, mock_create_table, mock_insert_table):
dest = DuneDestination(api_key="f00b4r", table_name="foo", request_timeout=10)
dest = DuneDestination(
api_key="f00b4r", table_name="foo.bar", request_timeout=10
)
df = TypedDataFrame(pd.DataFrame([{"foo": "bar"}]), {})

mock_create_table.return_value = {
Expand All @@ -98,9 +100,8 @@ def test_dune_error_handling(self, mock_create_table, mock_insert_table):

mock_create_table.side_effect = dune_err

data = TypedDataFrame(df, {})
with self.assertLogs(level=ERROR) as logs:
dest.save(data)
dest.save(df)

mock_create_table.assert_called_once()

Expand All @@ -115,7 +116,7 @@ def test_dune_error_handling(self, mock_create_table, mock_insert_table):
mock_create_table.side_effect = val_err

with self.assertLogs(level=ERROR) as logs:
dest.save(data)
dest.save(df)

mock_create_table.assert_called_once()
expected_message = "Data processing error: Oops"
Expand All @@ -124,7 +125,7 @@ def test_dune_error_handling(self, mock_create_table, mock_insert_table):
mock_create_table.reset_mock()
mock_create_table.side_effect = runtime_err
with self.assertLogs(level=ERROR) as logs:
dest.save(data)
dest.save(df)

mock_create_table.assert_called_once()
expected_message = "Data processing error: Big Oops"
Expand All @@ -138,7 +139,7 @@ def test_dune_error_handling(self, mock_create_table, mock_insert_table):
mock_create_table.return_value = None

with self.assertLogs(level=ERROR) as logs:
dest.save(data)
dest.save(df)

mock_create_table.assert_called_once()
self.assertIn("Dune Upload Failed", logs.output[0])
Expand Down

0 comments on commit b38d67e

Please sign in to comment.