diff --git a/tests/integration/flows/test_adls_to_azure_sql.py b/tests/integration/flows/test_adls_to_azure_sql.py index e13dc31b2..d52e4023e 100644 --- a/tests/integration/flows/test_adls_to_azure_sql.py +++ b/tests/integration/flows/test_adls_to_azure_sql.py @@ -101,3 +101,32 @@ def test_check_dtypes_sort(): assert False except signals.FAIL: assert True + + +def test_adls_to_azure_sql_mocked(TEST_CSV_FILE_PATH): + with mock.patch.object(ADLSToAzureSQL, "run", return_value=True) as mock_method: + instance = ADLSToAzureSQL( + name="test_adls_to_azure_sql_flow", + adls_path=TEST_CSV_FILE_PATH, + schema="sandbox", + table="test_bcp", + dtypes={"test_str": "VARCHAR(25)", "test_int": "INT"}, + if_exists="replace", + ) + instance.run() + mock_method.assert_called_with() + + +def test_adls_to_azure_sql_mocked_validate_df_param(TEST_CSV_FILE_PATH): + with mock.patch.object(ADLSToAzureSQL, "run", return_value=True) as mock_method: + instance = ADLSToAzureSQL( + name="test_adls_to_azure_sql_flow", + adls_path=TEST_CSV_FILE_PATH, + schema="sandbox", + table="test_bcp", + dtypes={"test_str": "VARCHAR(25)", "test_int": "INT"}, + if_exists="replace", + validate_df_dict={"column_list_to_match": ["test_str", "test_int"]}, + ) + instance.run() + mock_method.assert_called_with()