From d13693cd9dbf731558e7d5307f54104c858562a4 Mon Sep 17 00:00:00 2001 From: Isaac Ireland Date: Tue, 12 Nov 2024 16:47:59 +0000 Subject: [PATCH] remove redundant test --- .../tests/test_snowflake_table_retriever.py | 50 ------------------- 1 file changed, 50 deletions(-) diff --git a/integrations/snowflake/tests/test_snowflake_table_retriever.py b/integrations/snowflake/tests/test_snowflake_table_retriever.py index f5b8fee37..577978f11 100644 --- a/integrations/snowflake/tests/test_snowflake_table_retriever.py +++ b/integrations/snowflake/tests/test_snowflake_table_retriever.py @@ -236,56 +236,6 @@ def test_execute_sql_query( assert result.equals(expected) - @patch( - "haystack_integrations.components.retrievers.snowflake.snowflake_table_retriever.snowflake.connector.connect" - ) - def test_is_select_only( - self, mock_connect: MagicMock, snowflake_table_retriever: SnowflakeTableRetriever, caplog: LogCaptureFixture - ) -> None: - mock_conn = MagicMock() - mock_cursor = MagicMock() - mock_conn.cursor.return_value = mock_cursor - mock_connect.return_value = mock_conn - mock_cursor.fetchall.side_effect = [ - [("DATETIME", "ROLE_NAME", "USER", "USER_NAME", "GRANTED_BY")], # User roles - [ - ( - "DATETIME", - "SELECT", - "TABLE", - "LOCATIONS", - "ROLE", - "ROLE_NAME", - "GRANT_OPTION", - "GRANTED_BY", - ) - ], # Table privileges - ] - - query = "select * from locations" - result = snowflake_table_retriever._check_privilege(conn=mock_conn, user="test_user", query=query) - assert result - - mock_cursor.fetchall.side_effect = [ - [("DATETIME", "ROLE_NAME", "USER", "USER_NAME", "GRANTED_BY")], # User roles - [ - ( - "DATETIME", - "INSERT", - "TABLE", - "LOCATIONS", - "ROLE", - "ROLE_NAME", - "GRANT_OPTION", - "GRANTED_BY", - ) - ], - ] - - result = snowflake_table_retriever._check_privilege(conn=mock_conn, user="test_user", query=query) - - assert not result - @patch( "haystack_integrations.components.retrievers.snowflake.snowflake_table_retriever.snowflake.connector.connect" )