Skip to content

Commit

Permalink
scaffold write test
Browse files Browse the repository at this point in the history
  • Loading branch information
IanRFerguson committed Mar 26, 2024
1 parent 0cd86e9 commit 1ceefd6
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/test_bigquery_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def _build_mock_cursor(self, query_results=None):
return bq

@mock.patch("polars.from_arrow")
def test_read_dataframe_from_bigquery(self, from_arrow):
def test_read_dataframe_from_bigquery(self, mock_from_arrow):
"Tests read functionality for the `BigQueryConnector` object"

sql = "select * from my_table"
Expand All @@ -58,6 +58,12 @@ def test_read_dataframe_from_bigquery(self, from_arrow):

assert isinstance(df, type(None))

def test_write_dataframe_to_bigquery(self):
@mock.patch("polars.DataFrame.write_parquet")
def test_write_dataframe_to_bigquery(self, mock_write_parquet):
"Tests write functionality for the `BigQueryConnector` object"
pass

df = mock.MagicMock()
table_name = "foo.bar"

bq = self._build_mock_cursor()
bq.write_dataframe_to_bigquery(df=df, table_name=table_name)

0 comments on commit 1ceefd6

Please sign in to comment.