Skip to content

Commit

Permalink
Remove NativeAppManager SQL mocks (#1617)
Browse files Browse the repository at this point in the history
Switch some mocks of `NativeAppManager._execute_X` to mock `SqlExecutor.execute_X` instead.
  • Loading branch information
sfc-gh-fcampbell authored Sep 23, 2024
1 parent a6aa19f commit 5d8ac9a
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions tests/nativeapp/test_package_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@

from tests.nativeapp.patch_utils import mock_connection
from tests.nativeapp.utils import (
NATIVEAPP_MANAGER_EXECUTE,
NATIVEAPP_MANAGER_EXECUTE_QUERIES,
SQL_EXECUTOR_EXECUTE,
SQL_EXECUTOR_EXECUTE_QUERIES,
)
Expand Down Expand Up @@ -116,8 +114,8 @@ def test_package_scripts_with_conn_info(


# Without connection warehouse, without PDF warehouse
@mock.patch(NATIVEAPP_MANAGER_EXECUTE_QUERIES)
@mock.patch(NATIVEAPP_MANAGER_EXECUTE)
@mock.patch(SQL_EXECUTOR_EXECUTE_QUERIES)
@mock.patch(SQL_EXECUTOR_EXECUTE)
@mock_connection()
@pytest.mark.parametrize("project_definition_files", ["napp_project_1"], indirect=True)
def test_package_scripts_without_conn_info_throws_error(
Expand Down Expand Up @@ -192,7 +190,7 @@ def test_package_scripts_without_conn_info_succeeds(
]


@mock.patch(NATIVEAPP_MANAGER_EXECUTE_QUERIES)
@mock.patch(SQL_EXECUTOR_EXECUTE_QUERIES)
@mock_connection()
@pytest.mark.parametrize("project_definition_files", ["napp_project_1"], indirect=True)
def test_missing_package_script(mock_conn, mock_execute, project_definition_files):
Expand All @@ -207,7 +205,7 @@ def test_missing_package_script(mock_conn, mock_execute, project_definition_file
assert mock_execute.mock_calls == []


@mock.patch(NATIVEAPP_MANAGER_EXECUTE_QUERIES)
@mock.patch(SQL_EXECUTOR_EXECUTE_QUERIES)
@mock_connection()
@pytest.mark.parametrize("project_definition_files", ["napp_project_1"], indirect=True)
def test_invalid_package_script(mock_conn, mock_execute, project_definition_files):
Expand All @@ -224,7 +222,7 @@ def test_invalid_package_script(mock_conn, mock_execute, project_definition_file
assert mock_execute.mock_calls == []


@mock.patch(NATIVEAPP_MANAGER_EXECUTE_QUERIES)
@mock.patch(SQL_EXECUTOR_EXECUTE_QUERIES)
@mock_connection()
@pytest.mark.parametrize("project_definition_files", ["napp_project_1"], indirect=True)
def test_undefined_var_package_script(
Expand Down

0 comments on commit 5d8ac9a

Please sign in to comment.