Skip to content

Commit

Permalink
fix test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
vatsrahul1001 committed Jan 18, 2024
1 parent b1a6a48 commit e3a4a20
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/providers/snowflake/operators/test_snowflake.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,9 @@ def test_snowflake_sql_api_to_fails_when_one_query_fails(

@pytest.mark.parametrize("mock_sql, statement_count", [(SQL_MULTIPLE_STMTS, 4), (SINGLE_STMT, 1)])
@mock.patch("airflow.providers.snowflake.hooks.snowflake_sql_api.SnowflakeSqlApiHook.execute_query")
def test_snowflake_sql_api_execute_operator_async(self, mock_db_hook, mock_sql, statement_count):
def test_snowflake_sql_api_execute_operator_async(
self, mock_execute_query, mock_sql, statement_count, mock_get_sql_api_query_status
):
"""
Asserts that a task is deferred and an SnowflakeSqlApiTrigger will be fired
when the SnowflakeSqlApiOperator is executed.
Expand All @@ -266,6 +268,9 @@ def test_snowflake_sql_api_execute_operator_async(self, mock_db_hook, mock_sql,
deferrable=True,
)

mock_execute_query.return_value = ["uuid1"]
mock_get_sql_api_query_status.side_effect = [{"status": "running"}]

with pytest.raises(TaskDeferred) as exc:
operator.execute(create_context(operator))

Expand Down

0 comments on commit e3a4a20

Please sign in to comment.