Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pankajastro committed Jan 23, 2023
1 parent 1d58410 commit 4b9d97b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/snowflake/hooks/test_snowflake.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ def test_run_storing_query_ids(self, mock_conn, sql, expected_sql, expected_quer
assert hook.query_ids == expected_query_ids
cur.close.assert_called()

@mock.patch("astronomer.providers.snowflake.hooks.snowflake.SnowflakeHookAsync.get_conn")
def test_run_empty_query_list(self, mock_conn):
hook = SnowflakeHookAsync()
mock_conn.return_value = mock.MagicMock()
mock_params = {"mock_param": "mock_param"}
with pytest.raises(ValueError) as exc_info:
hook.run([], parameters=mock_params)
assert str(exc_info.value) == "List of SQL statements is empty"

@pytest.mark.parametrize(
"sql,expected_sql,expected_query_ids",
[
Expand Down

0 comments on commit 4b9d97b

Please sign in to comment.