diff --git a/parsers/commands/activate_parser_test.py b/parsers/commands/activate_parser_test.py index fb66e33..beeeb27 100644 --- a/parsers/commands/activate_parser_test.py +++ b/parsers/commands/activate_parser_test.py @@ -18,7 +18,7 @@ from click import testing -from google3.third_party.chronicle.cli import mock_test_utility +from mock_test_utility import MockResponse from parsers import url from parsers.commands import activate_parser from parsers.tests.fixtures import * # pylint: disable=wildcard-import @@ -41,13 +41,13 @@ def test_activate_parser( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_data_activate_parser: mock_test_utility.MockResponse) -> None: + test_data_activate_parser: MockResponse) -> None: """Test case to check response for activate parser. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_data_activate_parser (mock_test_utility.MockResponse): Test input data + test_data_activate_parser (MockResponse): Test input data """ mock_get_dataplane_url.return_value = ACTIVATE_URL client = mock.Mock() @@ -68,13 +68,13 @@ def test_activate_parser( def test_activate_parser_v2_flag_not_provided( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_v2flag_not_provided: mock_test_utility.MockResponse) -> None: + test_v2flag_not_provided: MockResponse) -> None: """Test case to check response for v2 flag not provided. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_v2flag_not_provided (mock_test_utility.MockResponse): Test input data + test_v2flag_not_provided (MockResponse): Test input data """ mock_get_dataplane_url.return_value = ACTIVATE_URL client = mock.Mock() @@ -92,13 +92,13 @@ def test_activate_parser_v2_flag_not_provided( def test_activate_parser_empty_project_id( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_empty_project_id: mock_test_utility.MockResponse) -> None: + test_empty_project_id: MockResponse) -> None: """Test case to check response for empty Project ID. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_empty_project_id (mock_test_utility.MockResponse): Test input data + test_empty_project_id (MockResponse): Test input data """ mock_get_dataplane_url.return_value = ACTIVATE_URL client = mock.Mock() @@ -117,13 +117,13 @@ def test_activate_parser_empty_project_id( def test_activate_parser_empty_customer_id( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_empty_customer_id: mock_test_utility.MockResponse) -> None: + test_empty_customer_id: MockResponse) -> None: """Test case to check response for empty Customer ID. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_empty_customer_id (mock_test_utility.MockResponse): Test input data + test_empty_customer_id (MockResponse): Test input data """ mock_get_dataplane_url.return_value = ACTIVATE_URL client = mock.Mock() @@ -143,13 +143,13 @@ def test_activate_parser_empty_customer_id( def test_activate_parser_empty_log_type( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_empty_log_type: mock_test_utility.MockResponse) -> None: + test_empty_log_type: MockResponse) -> None: """Test case to check response for empty Log Type. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_empty_log_type (mock_test_utility.MockResponse): Test input data + test_empty_log_type (MockResponse): Test input data """ mock_get_dataplane_url.return_value = ACTIVATE_URL client = mock.Mock() @@ -169,13 +169,13 @@ def test_activate_parser_empty_log_type( def test_activate_parser_empty_parser_id( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_empty_parser_id: mock_test_utility.MockResponse) -> None: + test_empty_parser_id: MockResponse) -> None: """Test case to check response for empty Parser ID. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_empty_parser_id (mock_test_utility.MockResponse): Test input data + test_empty_parser_id (MockResponse): Test input data """ mock_get_dataplane_url.return_value = ACTIVATE_URL client = mock.Mock() @@ -195,13 +195,13 @@ def test_activate_parser_empty_parser_id( def test_activate_parser_500( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_500_resp: mock_test_utility.MockResponse) -> None: + test_500_resp: MockResponse) -> None: """Test case to check response for activate parser for 500 response code. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_500_resp (mock_test_utility.MockResponse): Test input data + test_500_resp (MockResponse): Test input data """ mock_get_dataplane_url.return_value = ACTIVATE_URL client = mock.Mock() diff --git a/parsers/commands/classify_log_type_test.py b/parsers/commands/classify_log_type_test.py index 6b6c6da..7fd76f1 100644 --- a/parsers/commands/classify_log_type_test.py +++ b/parsers/commands/classify_log_type_test.py @@ -18,7 +18,7 @@ from click import testing -from google3.third_party.chronicle.cli import mock_test_utility +from mock_test_utility import MockResponse from parsers import url from parsers.commands import classify_log_type from parsers.tests.fixtures import * # pylint: disable=wildcard-import @@ -47,7 +47,7 @@ def test_classify_log_type( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, mock_time: mock.MagicMock, - test_data_classify_log_type: mock_test_utility.MockResponse, + test_data_classify_log_type: MockResponse, ) -> None: """Test case to check success response. @@ -55,7 +55,7 @@ def test_classify_log_type( mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object mock_time (mock.MagicMock): Mock object - test_data_classify_log_type (mock_test_utility.MockResponse): Test input + test_data_classify_log_type (MockResponse): Test input data """ mock_time.return_value = 0.0 @@ -92,14 +92,14 @@ def test_classify_log_type( def test_classify_log_type_v2_flag_not_provided( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_v2flag_not_provided: mock_test_utility.MockResponse, + test_v2flag_not_provided: MockResponse, ) -> None: """Test case to check response for v2 flag not provided. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_v2flag_not_provided (mock_test_utility.MockResponse): Test input data + test_v2flag_not_provided (MockResponse): Test input data """ mock_get_dataplane_url.return_value = CLASSIFY_LOG_TYPE_URL client = mock.Mock() @@ -119,14 +119,14 @@ def test_classify_log_type_v2_flag_not_provided( def test_classify_log_type_empty_project_id( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_empty_project_id: mock_test_utility.MockResponse, + test_empty_project_id: MockResponse, ) -> None: """Test case to check response for empty Project ID. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_empty_project_id (mock_test_utility.MockResponse): Test input data + test_empty_project_id (MockResponse): Test input data """ mock_get_dataplane_url.return_value = CLASSIFY_LOG_TYPE_URL client = mock.Mock() @@ -147,14 +147,14 @@ def test_classify_log_type_empty_project_id( def test_classify_log_type_empty_customer_id( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_empty_customer_id: mock_test_utility.MockResponse, + test_empty_customer_id: MockResponse, ) -> None: """Test case to check response for empty Customer ID. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_empty_customer_id (mock_test_utility.MockResponse): Test input data + test_empty_customer_id (MockResponse): Test input data """ mock_get_dataplane_url.return_value = CLASSIFY_LOG_TYPE_URL client = mock.Mock() @@ -175,14 +175,14 @@ def test_classify_log_type_empty_customer_id( def test_classify_log_type_non_existing_log_file( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_data_non_existing_log_file: mock_test_utility.MockResponse, + test_data_non_existing_log_file: MockResponse, ) -> None: """Test case to check response for non existing log file. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_data_non_existing_log_file (mock_test_utility.MockResponse): Test input + test_data_non_existing_log_file (MockResponse): Test input data """ mock_get_dataplane_url.return_value = CLASSIFY_LOG_TYPE_URL @@ -223,7 +223,7 @@ def test_classify_log_type_empty_response( mock_get_dataplane_url.return_value = CLASSIFY_LOG_TYPE_URL client = mock.Mock() client.request.side_effect = [ - mock_test_utility.MockResponse(status_code=200, text="""{}""") + MockResponse(status_code=200, text="""{}""") ] mock_http_session.return_value = client result = runner.invoke( @@ -252,14 +252,14 @@ def test_classify_log_type_empty_response( def test_classify_log_type_500( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_500_resp: mock_test_utility.MockResponse, + test_500_resp: MockResponse, ) -> None: """Test case to check response for 500 response code. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_500_resp (mock_test_utility.MockResponse): Test input data + test_500_resp (MockResponse): Test input data """ create_temp_log_file(TEMP_SUBMIT_LOG_FILE, "test_log1\ntest_log2") mock_get_dataplane_url.return_value = CLASSIFY_LOG_TYPE_URL diff --git a/parsers/commands/deactivate_parser_test.py b/parsers/commands/deactivate_parser_test.py index ae988a1..bdcff24 100644 --- a/parsers/commands/deactivate_parser_test.py +++ b/parsers/commands/deactivate_parser_test.py @@ -18,7 +18,7 @@ from click import testing -from google3.third_party.chronicle.cli import mock_test_utility +from mock_test_utility import MockResponse from parsers import url from parsers.commands import deactivate_parser from parsers.tests.fixtures import * # pylint: disable=wildcard-import @@ -42,13 +42,13 @@ def test_deactivate_parser( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_data_deactivate_parser: mock_test_utility.MockResponse) -> None: + test_data_deactivate_parser: MockResponse) -> None: """Test case to check response for deactivate parser. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_data_deactivate_parser (mock_test_utility.MockResponse): Test input + test_data_deactivate_parser (MockResponse): Test input data """ mock_get_dataplane_url.return_value = DEACTIVATE_URL @@ -70,13 +70,13 @@ def test_deactivate_parser( def test_activate_parser_v2_flag_not_provided( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_v2flag_not_provided: mock_test_utility.MockResponse) -> None: + test_v2flag_not_provided: MockResponse) -> None: """Test case to check response for v2 flag not provided. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_v2flag_not_provided (mock_test_utility.MockResponse): Test input data + test_v2flag_not_provided (MockResponse): Test input data """ mock_get_dataplane_url.return_value = DEACTIVATE_URL client = mock.Mock() @@ -94,13 +94,13 @@ def test_activate_parser_v2_flag_not_provided( def test_deactivate_parser_empty_project_id( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_empty_project_id: mock_test_utility.MockResponse) -> None: + test_empty_project_id: MockResponse) -> None: """Test case to check response for empty Project ID. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_empty_project_id (mock_test_utility.MockResponse): Test input data + test_empty_project_id (MockResponse): Test input data """ mock_get_dataplane_url.return_value = DEACTIVATE_URL client = mock.Mock() @@ -119,13 +119,13 @@ def test_deactivate_parser_empty_project_id( def test_deactivate_parser_empty_customer_id( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_empty_customer_id: mock_test_utility.MockResponse) -> None: + test_empty_customer_id: MockResponse) -> None: """Test case to check response for empty Customer ID. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_empty_customer_id (mock_test_utility.MockResponse): Test input data + test_empty_customer_id (MockResponse): Test input data """ mock_get_dataplane_url.return_value = DEACTIVATE_URL client = mock.Mock() @@ -145,13 +145,13 @@ def test_deactivate_parser_empty_customer_id( def test_deactivate_parser_empty_log_type( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_empty_log_type: mock_test_utility.MockResponse) -> None: + test_empty_log_type: MockResponse) -> None: """Test case to check response for empty Log Type. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_empty_log_type (mock_test_utility.MockResponse): Test input data + test_empty_log_type (MockResponse): Test input data """ mock_get_dataplane_url.return_value = DEACTIVATE_URL client = mock.Mock() @@ -171,13 +171,13 @@ def test_deactivate_parser_empty_log_type( def test_deactivate_parser_empty_parser_id( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_empty_parser_id: mock_test_utility.MockResponse) -> None: + test_empty_parser_id: MockResponse) -> None: """Test case to check response for empty Parser ID. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_empty_parser_id (mock_test_utility.MockResponse): Test input data + test_empty_parser_id (MockResponse): Test input data """ mock_get_dataplane_url.return_value = DEACTIVATE_URL client = mock.Mock() @@ -197,13 +197,13 @@ def test_deactivate_parser_empty_parser_id( def test_deactivate_parser_500( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_500_resp: mock_test_utility.MockResponse) -> None: + test_500_resp: MockResponse) -> None: """Test case to check response for deactivate parser for 500 response code. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_500_resp (mock_test_utility.MockResponse): Test input data + test_500_resp (MockResponse): Test input data """ mock_get_dataplane_url.return_value = DEACTIVATE_URL client = mock.Mock() diff --git a/parsers/commands/delete_extension_test.py b/parsers/commands/delete_extension_test.py index fe31b7d..e861c5f 100644 --- a/parsers/commands/delete_extension_test.py +++ b/parsers/commands/delete_extension_test.py @@ -18,7 +18,7 @@ from click import testing -from google3.third_party.chronicle.cli import mock_test_utility +from mock_test_utility import MockResponse from parsers import url from parsers.commands import delete_extension from parsers.tests.fixtures import * # pylint: disable=wildcard-import @@ -41,13 +41,13 @@ def test_delete_extension( mock_get_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_data_delete_extension: mock_test_utility.MockResponse) -> None: + test_data_delete_extension: MockResponse) -> None: """Test case to check response for delete extension. Args: mock_get_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_data_delete_extension (mock_test_utility.MockResponse): Test input data + test_data_delete_extension (MockResponse): Test input data """ mock_get_url.return_value = DELETE_URL client = mock.Mock() @@ -69,13 +69,13 @@ def test_delete_extension( def test_delete_extension_v2_flag_not_provided( mock_get_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_v2flag_not_provided: mock_test_utility.MockResponse) -> None: + test_v2flag_not_provided: MockResponse) -> None: """Test case to check response for v2 flag not provided. Args: mock_get_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_v2flag_not_provided (mock_test_utility.MockResponse): Test input data + test_v2flag_not_provided (MockResponse): Test input data """ mock_get_url.return_value = DELETE_URL client = mock.Mock() @@ -93,13 +93,13 @@ def test_delete_extension_v2_flag_not_provided( def test_delete_extension_empty_project_id( mock_get_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_empty_project_id: mock_test_utility.MockResponse) -> None: + test_empty_project_id: MockResponse) -> None: """Test case to check response for empty Project ID. Args: mock_get_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_empty_project_id (mock_test_utility.MockResponse): Test input data + test_empty_project_id (MockResponse): Test input data """ mock_get_url.return_value = DELETE_URL client = mock.Mock() @@ -118,13 +118,13 @@ def test_delete_extension_empty_project_id( def test_delete_extension_empty_customer_id( mock_get_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_empty_customer_id: mock_test_utility.MockResponse) -> None: + test_empty_customer_id: MockResponse) -> None: """Test case to check response for empty Customer ID. Args: mock_get_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_empty_customer_id (mock_test_utility.MockResponse): Test input data + test_empty_customer_id (MockResponse): Test input data """ mock_get_url.return_value = DELETE_URL client = mock.Mock() @@ -144,13 +144,13 @@ def test_delete_extension_empty_customer_id( def test_delete_extension_empty_log_type( mock_get_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_empty_log_type: mock_test_utility.MockResponse) -> None: + test_empty_log_type: MockResponse) -> None: """Test case to check response for empty Log Type. Args: mock_get_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_empty_log_type (mock_test_utility.MockResponse): Test input data + test_empty_log_type (MockResponse): Test input data """ mock_get_url.return_value = DELETE_URL client = mock.Mock() @@ -170,13 +170,13 @@ def test_delete_extension_empty_log_type( def test_delete_extension_empty_parserextension_id( mock_get_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_empty_parserextension_id: mock_test_utility.MockResponse) -> None: + test_empty_parserextension_id: MockResponse) -> None: """Test case to check response for empty ParserExtension ID. Args: mock_get_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_empty_parserextension_id (mock_test_utility.MockResponse): Test input + test_empty_parserextension_id (MockResponse): Test input data """ mock_get_url.return_value = DELETE_URL @@ -197,13 +197,13 @@ def test_delete_extension_empty_parserextension_id( def test_delete_extension_500( mock_get_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_500_resp: mock_test_utility.MockResponse) -> None: + test_500_resp: MockResponse) -> None: """Test case to check response for 500 response code. Args: mock_get_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_500_resp (mock_test_utility.MockResponse): Test input data + test_500_resp (MockResponse): Test input data """ mock_get_url.return_value = DELETE_URL client = mock.Mock() diff --git a/parsers/commands/delete_parser_test.py b/parsers/commands/delete_parser_test.py index 3a66262..d58b42b 100644 --- a/parsers/commands/delete_parser_test.py +++ b/parsers/commands/delete_parser_test.py @@ -18,7 +18,7 @@ from click import testing -from google3.third_party.chronicle.cli import mock_test_utility +from mock_test_utility import MockResponse from parsers import url from parsers.commands import delete_parser from parsers.tests.fixtures import * # pylint: disable=wildcard-import @@ -41,13 +41,13 @@ def test_delete_parser( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_data_delete_parser: mock_test_utility.MockResponse) -> None: + test_data_delete_parser: MockResponse) -> None: """Test case to check response for delete parser. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_data_delete_parser (mock_test_utility.MockResponse): Test input data + test_data_delete_parser (MockResponse): Test input data """ mock_get_dataplane_url.return_value = DELETE_URL client = mock.Mock() @@ -68,13 +68,13 @@ def test_delete_parser( def test_delete_parser_v2_flag_not_provided( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_v2flag_not_provided: mock_test_utility.MockResponse) -> None: + test_v2flag_not_provided: MockResponse) -> None: """Test case to check response for v2 flag not provided. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_v2flag_not_provided (mock_test_utility.MockResponse): Test input data + test_v2flag_not_provided (MockResponse): Test input data """ mock_get_dataplane_url.return_value = DELETE_URL client = mock.Mock() @@ -92,13 +92,13 @@ def test_delete_parser_v2_flag_not_provided( def test_delete_parser_empty_project_id( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_empty_project_id: mock_test_utility.MockResponse) -> None: + test_empty_project_id: MockResponse) -> None: """Test case to check response for empty Project ID. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_empty_project_id (mock_test_utility.MockResponse): Test input data + test_empty_project_id (MockResponse): Test input data """ mock_get_dataplane_url.return_value = DELETE_URL client = mock.Mock() @@ -117,13 +117,13 @@ def test_delete_parser_empty_project_id( def test_delete_parser_empty_customer_id( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_empty_customer_id: mock_test_utility.MockResponse) -> None: + test_empty_customer_id: MockResponse) -> None: """Test case to check response for empty Customer ID. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_empty_customer_id (mock_test_utility.MockResponse): Test input data + test_empty_customer_id (MockResponse): Test input data """ mock_get_dataplane_url.return_value = DELETE_URL client = mock.Mock() @@ -143,13 +143,13 @@ def test_delete_parser_empty_customer_id( def test_delete_parser_empty_log_type( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_empty_log_type: mock_test_utility.MockResponse) -> None: + test_empty_log_type: MockResponse) -> None: """Test case to check response for empty Log Type. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_empty_log_type (mock_test_utility.MockResponse): Test input data + test_empty_log_type (MockResponse): Test input data """ mock_get_dataplane_url.return_value = DELETE_URL client = mock.Mock() @@ -169,13 +169,13 @@ def test_delete_parser_empty_log_type( def test_delete_parser_empty_parser_id( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_empty_parser_id: mock_test_utility.MockResponse) -> None: + test_empty_parser_id: MockResponse) -> None: """Test case to check response for empty Parser ID. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_empty_parser_id (mock_test_utility.MockResponse): Test input data + test_empty_parser_id (MockResponse): Test input data """ mock_get_dataplane_url.return_value = DELETE_URL client = mock.Mock() @@ -195,13 +195,13 @@ def test_delete_parser_empty_parser_id( def test_delete_parser_500( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_500_resp: mock_test_utility.MockResponse) -> None: + test_500_resp: MockResponse) -> None: """Test case to check response for 500 response code. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_500_resp (mock_test_utility.MockResponse): Test input data + test_500_resp (MockResponse): Test input data """ mock_get_dataplane_url.return_value = DELETE_URL client = mock.Mock() diff --git a/parsers/commands/get_extension_test.py b/parsers/commands/get_extension_test.py index 2961062..c59165a 100644 --- a/parsers/commands/get_extension_test.py +++ b/parsers/commands/get_extension_test.py @@ -20,7 +20,7 @@ from click import _compat from click import testing -from google3.third_party.chronicle.cli import mock_test_utility +from mock_test_utility import MockResponse from common import file_utility from parsers import url from parsers.commands import get_extension @@ -46,13 +46,13 @@ def test_get_extension( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_data_get_extension: mock_test_utility.MockResponse) -> None: + test_data_get_extension: MockResponse) -> None: """Test case to check success response. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_data_get_extension (mock_test_utility.MockResponse): Test input data + test_data_get_extension (MockResponse): Test input data """ mock_get_dataplane_url.return_value = GET_URL client = mock.Mock() @@ -89,13 +89,13 @@ def test_get_extension( def test_get_extension_v2_flag_not_provided( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_v2flag_not_provided: mock_test_utility.MockResponse) -> None: + test_v2flag_not_provided: MockResponse) -> None: """Test case to check response for v2 flag not provided. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_v2flag_not_provided (mock_test_utility.MockResponse): Test input data + test_v2flag_not_provided (MockResponse): Test input data """ mock_get_dataplane_url.return_value = GET_URL client = mock.Mock() @@ -113,13 +113,13 @@ def test_get_extension_v2_flag_not_provided( def test_get_extension_empty_project_id( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_empty_project_id: mock_test_utility.MockResponse) -> None: + test_empty_project_id: MockResponse) -> None: """Test case to check response for empty Project ID. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_empty_project_id (mock_test_utility.MockResponse): Test input data + test_empty_project_id (MockResponse): Test input data """ mock_get_dataplane_url.return_value = GET_URL client = mock.Mock() @@ -138,13 +138,13 @@ def test_get_extension_empty_project_id( def test_get_extension_empty_customer_id( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_empty_customer_id: mock_test_utility.MockResponse) -> None: + test_empty_customer_id: MockResponse) -> None: """Test case to check response for empty Customer ID. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_empty_customer_id (mock_test_utility.MockResponse): Test input data + test_empty_customer_id (MockResponse): Test input data """ mock_get_dataplane_url.return_value = GET_URL client = mock.Mock() @@ -164,13 +164,13 @@ def test_get_extension_empty_customer_id( def test_get_extension_empty_log_type( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_empty_log_type: mock_test_utility.MockResponse) -> None: + test_empty_log_type: MockResponse) -> None: """Test case to check response for empty Log Type. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_empty_log_type (mock_test_utility.MockResponse): Test input data + test_empty_log_type (MockResponse): Test input data """ mock_get_dataplane_url.return_value = GET_URL client = mock.Mock() @@ -190,13 +190,13 @@ def test_get_extension_empty_log_type( def test_get_extension_empty_parserextension_id( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_empty_parserextension_id: mock_test_utility.MockResponse) -> None: + test_empty_parserextension_id: MockResponse) -> None: """Test case to check response for empty Parser ID. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_empty_parserextension_id (mock_test_utility.MockResponse): Test input + test_empty_parserextension_id (MockResponse): Test input data """ mock_get_dataplane_url.return_value = GET_URL @@ -226,7 +226,7 @@ def test_get_extension_empty_response( mock_get_dataplane_url.return_value = GET_URL client = mock.Mock() client.request.side_effect = [ - mock_test_utility.MockResponse(status_code=200, text="""{}""") + MockResponse(status_code=200, text="""{}""") ] mock_http_session.return_value = client result = runner.invoke(get_extension.get_extension, [ @@ -245,13 +245,13 @@ def test_get_extension_empty_response( def test_get_extension_500( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_500_resp: mock_test_utility.MockResponse) -> None: + test_500_resp: MockResponse) -> None: """Test case to check response for 500 response code. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_500_resp (mock_test_utility.MockResponse): Test input data + test_500_resp (MockResponse): Test input data """ mock_get_dataplane_url.return_value = GET_URL client = mock.Mock() @@ -275,14 +275,14 @@ def test_get_extension_500( def test_get_extension_missing_key( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_data_get_extension_missing_key: mock_test_utility.MockResponse + test_data_get_extension_missing_key: MockResponse ) -> None: """Test case to verify if key is missing from one of the parser details dict. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_data_get_extension_missing_key (mock_test_utility.MockResponse): Test + test_data_get_extension_missing_key (MockResponse): Test input data """ mock_get_dataplane_url.return_value = GET_URL @@ -335,13 +335,13 @@ def test_get_extension_exception( def test_get_extension_export( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_data_get_extension: mock_test_utility.MockResponse) -> None: + test_data_get_extension: MockResponse) -> None: """Test case to check export option with TXT file format. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_data_get_extension (mock_test_utility.MockResponse): Test input data + test_data_get_extension (MockResponse): Test input data """ mock_get_dataplane_url.return_value = GET_URL client = mock.Mock() @@ -400,13 +400,13 @@ def test_get_extension_export( def test_get_extension_export_json( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_data_get_extension: mock_test_utility.MockResponse) -> None: + test_data_get_extension: MockResponse) -> None: """Test case to check export option with JSON format. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_data_get_extension (mock_test_utility.MockResponse): Test input data + test_data_get_extension (MockResponse): Test input data """ mock_get_dataplane_url.return_value = GET_URL client = mock.Mock() diff --git a/parsers/commands/get_parser_test.py b/parsers/commands/get_parser_test.py index 936b903..4c57e70 100644 --- a/parsers/commands/get_parser_test.py +++ b/parsers/commands/get_parser_test.py @@ -20,7 +20,7 @@ from click import _compat from click import testing -from google3.third_party.chronicle.cli import mock_test_utility +from mock_test_utility import MockResponse from common import file_utility from parsers import url from parsers.commands import get_parser @@ -46,13 +46,13 @@ def test_get_parser( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_data_get_parser: mock_test_utility.MockResponse) -> None: + test_data_get_parser: MockResponse) -> None: """Test case to check success response. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_data_get_parser (mock_test_utility.MockResponse): Test input data + test_data_get_parser (MockResponse): Test input data """ mock_get_dataplane_url.return_value = GET_URL client = mock.Mock() @@ -88,13 +88,13 @@ def test_get_parser( def test_get_parser_v2_flag_not_provided( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_v2flag_not_provided: mock_test_utility.MockResponse) -> None: + test_v2flag_not_provided: MockResponse) -> None: """Test case to check response for v2 flag not provided. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_v2flag_not_provided (mock_test_utility.MockResponse): Test input data + test_v2flag_not_provided (MockResponse): Test input data """ mock_get_dataplane_url.return_value = GET_URL client = mock.Mock() @@ -112,13 +112,13 @@ def test_get_parser_v2_flag_not_provided( def test_get_parser_empty_project_id( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_empty_project_id: mock_test_utility.MockResponse) -> None: + test_empty_project_id: MockResponse) -> None: """Test case to check response for empty Project ID. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_empty_project_id (mock_test_utility.MockResponse): Test input data + test_empty_project_id (MockResponse): Test input data """ mock_get_dataplane_url.return_value = GET_URL client = mock.Mock() @@ -137,13 +137,13 @@ def test_get_parser_empty_project_id( def test_get_parser_empty_customer_id( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_empty_customer_id: mock_test_utility.MockResponse) -> None: + test_empty_customer_id: MockResponse) -> None: """Test case to check response for empty Customer ID. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_empty_customer_id (mock_test_utility.MockResponse): Test input data + test_empty_customer_id (MockResponse): Test input data """ mock_get_dataplane_url.return_value = GET_URL client = mock.Mock() @@ -163,13 +163,13 @@ def test_get_parser_empty_customer_id( def test_get_parser_empty_log_type( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_empty_log_type: mock_test_utility.MockResponse) -> None: + test_empty_log_type: MockResponse) -> None: """Test case to check response for empty Log Type. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_empty_log_type (mock_test_utility.MockResponse): Test input data + test_empty_log_type (MockResponse): Test input data """ mock_get_dataplane_url.return_value = GET_URL client = mock.Mock() @@ -189,13 +189,13 @@ def test_get_parser_empty_log_type( def test_get_parser_empty_parser_id( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_empty_parser_id: mock_test_utility.MockResponse) -> None: + test_empty_parser_id: MockResponse) -> None: """Test case to check response for empty Parser ID. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_empty_parser_id (mock_test_utility.MockResponse): Test input data + test_empty_parser_id (MockResponse): Test input data """ mock_get_dataplane_url.return_value = GET_URL client = mock.Mock() @@ -224,7 +224,7 @@ def test_get_parser_empty_response( mock_get_dataplane_url.return_value = GET_URL client = mock.Mock() client.request.side_effect = [ - mock_test_utility.MockResponse(status_code=200, text="""{}""") + MockResponse(status_code=200, text="""{}""") ] mock_http_session.return_value = client result = runner.invoke(get_parser.get_parser, [ @@ -242,13 +242,13 @@ def test_get_parser_empty_response( def test_get_parser_500( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_500_resp: mock_test_utility.MockResponse) -> None: + test_500_resp: MockResponse) -> None: """Test case to check response for 500 response code. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_500_resp (mock_test_utility.MockResponse): Test input data + test_500_resp (MockResponse): Test input data """ mock_get_dataplane_url.return_value = GET_URL client = mock.Mock() @@ -271,13 +271,13 @@ def test_get_parser_500( def test_get_parser_missing_key( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_data_get_parser_missing_key: mock_test_utility.MockResponse) -> None: + test_data_get_parser_missing_key: MockResponse) -> None: """Test case to verify if key is missing from one of the parser details dict. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_data_get_parser_missing_key (mock_test_utility.MockResponse): Test + test_data_get_parser_missing_key (MockResponse): Test input data """ mock_get_dataplane_url.return_value = GET_URL @@ -328,13 +328,13 @@ def test_get_parser_exception( def test_get_parser_export( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_data_get_parser: mock_test_utility.MockResponse) -> None: + test_data_get_parser: MockResponse) -> None: """Test case to check export option with TXT file format. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_data_get_parser (mock_test_utility.MockResponse): Test input data + test_data_get_parser (MockResponse): Test input data """ mock_get_dataplane_url.return_value = GET_URL client = mock.Mock() @@ -392,13 +392,13 @@ def test_get_parser_export( def test_get_parser_export_json( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_data_get_parser: mock_test_utility.MockResponse) -> None: + test_data_get_parser: MockResponse) -> None: """Test case to check export option with JSON format. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_data_get_parser (mock_test_utility.MockResponse): Test input data + test_data_get_parser (MockResponse): Test input data """ mock_get_dataplane_url.return_value = GET_URL client = mock.Mock() diff --git a/parsers/commands/get_validation_report_test.py b/parsers/commands/get_validation_report_test.py index f67a65f..e87b072 100644 --- a/parsers/commands/get_validation_report_test.py +++ b/parsers/commands/get_validation_report_test.py @@ -18,7 +18,7 @@ from click import testing -from google3.third_party.chronicle.cli import mock_test_utility +from mock_test_utility import MockResponse from common.constants import http_method from parsers import url from parsers.commands import get_validation_report @@ -73,7 +73,7 @@ def test_get_validation_report_for_parser( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_data_get_validation_report_for_parser: mock_test_utility.MockResponse + test_data_get_validation_report_for_parser: MockResponse ) -> None: """Test case to check success response. @@ -128,7 +128,7 @@ def test_get_validation_report_for_parser( def test_get_validation_report_for_parserextension( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_data_get_validation_report_for_parserextension: mock_test_utility.MockResponse + test_data_get_validation_report_for_parserextension: MockResponse ) -> None: """Test case to check success response. @@ -186,13 +186,13 @@ def test_get_validation_report_for_parserextension( def test_get_validation_report_v2_flag_not_provided( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_v2flag_not_provided: mock_test_utility.MockResponse) -> None: + test_v2flag_not_provided: MockResponse) -> None: """Test case to check response for v2 flag not provided. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_v2flag_not_provided (mock_test_utility.MockResponse): Test input data + test_v2flag_not_provided (MockResponse): Test input data """ mock_get_dataplane_url.return_value = GET_PARSER_VALIDATION_REPORT_URL client = mock.Mock() @@ -210,13 +210,13 @@ def test_get_validation_report_v2_flag_not_provided( def test_get_validation_report_empty_project_id( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_empty_project_id: mock_test_utility.MockResponse) -> None: + test_empty_project_id: MockResponse) -> None: """Test case to check response for empty Project ID. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_empty_project_id (mock_test_utility.MockResponse): Test input data + test_empty_project_id (MockResponse): Test input data """ mock_get_dataplane_url.return_value = GET_PARSER_VALIDATION_REPORT_URL client = mock.Mock() @@ -235,13 +235,13 @@ def test_get_validation_report_empty_project_id( def test_get_validation_report_empty_customer_id( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_empty_customer_id: mock_test_utility.MockResponse) -> None: + test_empty_customer_id: MockResponse) -> None: """Test case to check response for empty Customer ID. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_empty_customer_id (mock_test_utility.MockResponse): Test input data + test_empty_customer_id (MockResponse): Test input data """ mock_get_dataplane_url.return_value = GET_PARSER_VALIDATION_REPORT_URL client = mock.Mock() @@ -261,13 +261,13 @@ def test_get_validation_report_empty_customer_id( def test_get_validation_report_empty_log_type( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_empty_log_type: mock_test_utility.MockResponse) -> None: + test_empty_log_type: MockResponse) -> None: """Test case to check response for empty Log Type. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_empty_log_type (mock_test_utility.MockResponse): Test input data + test_empty_log_type (MockResponse): Test input data """ mock_get_dataplane_url.return_value = GET_PARSER_VALIDATION_REPORT_URL client = mock.Mock() @@ -287,13 +287,13 @@ def test_get_validation_report_empty_log_type( def test_get_validation_report_empty_validation_report_id( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_empty_valdiation_report_id: mock_test_utility.MockResponse) -> None: + test_empty_valdiation_report_id: MockResponse) -> None: """Test case to check response for empty Parser ID. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_empty_valdiation_report_id (mock_test_utility.MockResponse): Test input + test_empty_valdiation_report_id (MockResponse): Test input data """ mock_get_dataplane_url.return_value = GET_PARSER_VALIDATION_REPORT_URL @@ -314,7 +314,7 @@ def test_get_validation_report_empty_validation_report_id( def test_get_validation_report_empty_parser_id_and_parserextension_id( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_empty_parser_id_and_parserextension_id: mock_test_utility.MockResponse + test_empty_parser_id_and_parserextension_id: MockResponse ) -> None: """Test case to check response for empty Parser ID. @@ -342,7 +342,7 @@ def test_get_validation_report_empty_parser_id_and_parserextension_id( def test_get_validation_report_non_empty_parser_id_and_parserextension_id( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_non_empty_parser_id_and_parserextension_id: mock_test_utility.MockResponse + test_non_empty_parser_id_and_parserextension_id: MockResponse ) -> None: """Test case to check response for empty Parser ID. @@ -381,7 +381,7 @@ def test_get_validation_report_empty_response( mock_get_dataplane_url.return_value = GET_PARSER_VALIDATION_REPORT_URL client = mock.Mock() client.request.side_effect = [ - mock_test_utility.MockResponse(status_code=200, text="""{}""") + MockResponse(status_code=200, text="""{}""") ] mock_http_session.return_value = client result = runner.invoke(get_validation_report.get_validation_report, [ @@ -401,13 +401,13 @@ def test_get_validation_report_empty_response( def test_get_validation_report_500( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_500_resp: mock_test_utility.MockResponse) -> None: + test_500_resp: MockResponse) -> None: """Test case to check response for 500 response code. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_500_resp (mock_test_utility.MockResponse): Test input data + test_500_resp (MockResponse): Test input data """ mock_get_dataplane_url.return_value = GET_PARSER_VALIDATION_REPORT_URL client = mock.Mock() @@ -432,7 +432,7 @@ def test_get_validation_report_500( def test_get_validation_report_missing_key( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_data_get_validation_report_missing_key: mock_test_utility.MockResponse + test_data_get_validation_report_missing_key: MockResponse ) -> None: """Test case to verify if key is missing from one of the parser details dict. @@ -490,7 +490,7 @@ def test_get_validation_report_exception( def test_list_parsing_errors_for_parser( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_data_list_parsing_errors_for_parser: mock_test_utility.MockResponse + test_data_list_parsing_errors_for_parser: MockResponse ) -> None: """Test case to check success response. @@ -535,7 +535,7 @@ def test_list_parsing_errors_for_parser( def test_list_parsing_errors_for_parserextension( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_data_list_parsing_errors_for_parserextension: mock_test_utility.MockResponse + test_data_list_parsing_errors_for_parserextension: MockResponse ) -> None: """Test case to check success response. @@ -591,7 +591,7 @@ def test_list_parsing_errors_empty_response( mock_get_dataplane_url.return_value = LIST_PARSER_PARSING_ERRORS_URL client = mock.Mock() client.request.side_effect = [ - mock_test_utility.MockResponse(status_code=200, text="""{}""") + MockResponse(status_code=200, text="""{}""") ] mock_http_session.return_value = client got = get_validation_report.list_parsing_errors( diff --git a/parsers/commands/list_extensions_test.py b/parsers/commands/list_extensions_test.py index 4e857d1..38214d5 100644 --- a/parsers/commands/list_extensions_test.py +++ b/parsers/commands/list_extensions_test.py @@ -20,7 +20,7 @@ from click import _compat from click import testing -from google3.third_party.chronicle.cli import mock_test_utility +from mock_test_utility import MockResponse from common import file_utility from parsers import url from parsers.commands import list_extensions @@ -45,13 +45,13 @@ def test_list_extensions( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_data_list_extensions: mock_test_utility.MockResponse) -> None: + test_data_list_extensions: MockResponse) -> None: """Test case to check response for list ParserExtensions. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_data_list_extensions (mock_test_utility.MockResponse): Test input data + test_data_list_extensions (MockResponse): Test input data """ mock_get_dataplane_url.return_value = LIST_URL client = mock.Mock() @@ -87,13 +87,13 @@ def test_list_extensions( def test_list_extensions_v2_flag_not_provided( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_v2flag_not_provided: mock_test_utility.MockResponse) -> None: + test_v2flag_not_provided: MockResponse) -> None: """Test case to check response for v2 flag not provided. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_v2flag_not_provided (mock_test_utility.MockResponse): Test input data + test_v2flag_not_provided (MockResponse): Test input data """ mock_get_dataplane_url.return_value = LIST_URL client = mock.Mock() @@ -111,7 +111,7 @@ def test_list_extensions_v2_flag_not_provided( def test_list_extensions_empty_project_id( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_empty_project_id: mock_test_utility.MockResponse) -> None: + test_empty_project_id: MockResponse) -> None: """Test case to check response for empty Project ID. """ mock_get_dataplane_url.return_value = LIST_URL @@ -131,7 +131,7 @@ def test_list_extensions_empty_project_id( def test_list_extensions_empty_customer_id( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_empty_customer_id: mock_test_utility.MockResponse) -> None: + test_empty_customer_id: MockResponse) -> None: """Test case to check response for empty Customer ID. """ mock_get_dataplane_url.return_value = LIST_URL @@ -161,7 +161,7 @@ def test_list_extensions_empty_response( mock_get_dataplane_url.return_value = LIST_URL client = mock.Mock() client.request.side_effect = [ - mock_test_utility.MockResponse(status_code=200, text="""{}""") + MockResponse(status_code=200, text="""{}""") ] mock_http_session.return_value = client result = runner.invoke(list_extensions.list_extensions, [ @@ -179,14 +179,14 @@ def test_list_extensions_empty_response( def test_list_extensions_command_500( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_500_resp: mock_test_utility.MockResponse + test_500_resp: MockResponse ) -> None: """Test case to check response for list extensions for 500 response code. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_500_resp (mock_test_utility.MockResponse): Test input data + test_500_resp (MockResponse): Test input data """ mock_get_dataplane_url.return_value = LIST_URL client = mock.Mock() @@ -209,14 +209,14 @@ def test_list_extensions_command_500( def test_list_extensions_missing_key( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_data_list_extensions_missing_key: mock_test_utility.MockResponse + test_data_list_extensions_missing_key: MockResponse ) -> None: """Test case to verify if key is missing from one of the extension details dict. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_data_list_extensions_missing_key (mock_test_utility.MockResponse): Test + test_data_list_extensions_missing_key (MockResponse): Test input data """ mock_get_dataplane_url.return_value = LIST_URL @@ -264,13 +264,13 @@ def test_list_extensions_missing_key( def test_list_extensions_export( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_data_list_extensions: mock_test_utility.MockResponse) -> None: + test_data_list_extensions: MockResponse) -> None: """Test case to check export option with TXT file format for list extensions command. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_data_list_extensions (mock_test_utility.MockResponse): Test input data + test_data_list_extensions (MockResponse): Test input data """ mock_get_dataplane_url.return_value = LIST_URL client = mock.Mock() @@ -328,13 +328,13 @@ def test_list_extensions_export( def test_list_extensions_export_json( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_data_list_extensions: mock_test_utility.MockResponse) -> None: + test_data_list_extensions: MockResponse) -> None: """Test case to check export option with JSON file format for list extensions command. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_data_list_extensions (mock_test_utility.MockResponse): Test input data + test_data_list_extensions (MockResponse): Test input data """ mock_get_dataplane_url.return_value = LIST_URL client = mock.Mock() diff --git a/parsers/commands/list_parsers_test.py b/parsers/commands/list_parsers_test.py index 99c59e5..f3e5012 100644 --- a/parsers/commands/list_parsers_test.py +++ b/parsers/commands/list_parsers_test.py @@ -20,7 +20,7 @@ from click import _compat from click import testing -from google3.third_party.chronicle.cli import mock_test_utility +from mock_test_utility import MockResponse from common import file_utility from parsers import url from parsers.commands import list_parsers @@ -45,13 +45,13 @@ def test_list_parsers( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_data_list_parsers: mock_test_utility.MockResponse) -> None: + test_data_list_parsers: MockResponse) -> None: """Test case to check response for list parsers. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_data_list_parsers (mock_test_utility.MockResponse): Test input data + test_data_list_parsers (MockResponse): Test input data """ mock_get_dataplane_url.return_value = LIST_URL client = mock.Mock() @@ -88,13 +88,13 @@ def test_list_parsers( def test_list_parsers_v2_flag_not_provided( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_v2flag_not_provided: mock_test_utility.MockResponse) -> None: + test_v2flag_not_provided: MockResponse) -> None: """Test case to check response for v2 flag not provided. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_v2flag_not_provided (mock_test_utility.MockResponse): Test input data + test_v2flag_not_provided (MockResponse): Test input data """ mock_get_dataplane_url.return_value = LIST_URL client = mock.Mock() @@ -112,13 +112,13 @@ def test_list_parsers_v2_flag_not_provided( def test_list_parsers_empty_project_id( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_empty_project_id: mock_test_utility.MockResponse) -> None: + test_empty_project_id: MockResponse) -> None: """Test case to check response for empty Project ID. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_empty_project_id (mock_test_utility.MockResponse): Test input data + test_empty_project_id (MockResponse): Test input data """ mock_get_dataplane_url.return_value = LIST_URL client = mock.Mock() @@ -137,13 +137,13 @@ def test_list_parsers_empty_project_id( def test_list_parsers_empty_customer_id( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_empty_customer_id: mock_test_utility.MockResponse) -> None: + test_empty_customer_id: MockResponse) -> None: """Test case to check response for empty Customer ID. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_empty_customer_id (mock_test_utility.MockResponse): Test input data + test_empty_customer_id (MockResponse): Test input data """ mock_get_dataplane_url.return_value = LIST_URL client = mock.Mock() @@ -172,7 +172,7 @@ def test_list_parsers_empty_response( mock_get_dataplane_url.return_value = LIST_URL client = mock.Mock() client.request.side_effect = [ - mock_test_utility.MockResponse(status_code=200, text="""{}""") + MockResponse(status_code=200, text="""{}""") ] mock_http_session.return_value = client result = runner.invoke(list_parsers.list_parsers, [ @@ -190,14 +190,14 @@ def test_list_parsers_empty_response( def test_list_parsers_command_500( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_500_resp: mock_test_utility.MockResponse + test_500_resp: MockResponse ) -> None: """Test case to check response for list parsers for 500 response code. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_500_resp (mock_test_utility.MockResponse): Test input data + test_500_resp (MockResponse): Test input data """ mock_get_dataplane_url.return_value = LIST_URL client = mock.Mock() @@ -220,13 +220,13 @@ def test_list_parsers_command_500( def test_list_parsers_missing_key( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_data_list_parsers_missing_key: mock_test_utility.MockResponse) -> None: + test_data_list_parsers_missing_key: MockResponse) -> None: """Test case to verify if key is missing from one of the parser details dict. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_data_list_parsers_missing_key (mock_test_utility.MockResponse): Test + test_data_list_parsers_missing_key (MockResponse): Test input data """ mock_get_dataplane_url.return_value = LIST_URL @@ -299,13 +299,13 @@ def test_list_parsers_exception( def test_list_parsers_export( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_data_list_parsers: mock_test_utility.MockResponse) -> None: + test_data_list_parsers: MockResponse) -> None: """Test case to check export option with TXT file format for list command. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_data_list_parsers (mock_test_utility.MockResponse): Test input data + test_data_list_parsers (MockResponse): Test input data """ mock_get_dataplane_url.return_value = LIST_URL client = mock.Mock() @@ -363,13 +363,13 @@ def test_list_parsers_export( def test_list_parsers_export_json( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_data_list_parsers: mock_test_utility.MockResponse) -> None: + test_data_list_parsers: MockResponse) -> None: """Test case to check export option with JSON format for list parsers command. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_data_list_parsers (mock_test_utility.MockResponse): Test input data + test_data_list_parsers (MockResponse): Test input data """ mock_get_dataplane_url.return_value = LIST_URL client = mock.Mock() diff --git a/parsers/commands/run_parser_test.py b/parsers/commands/run_parser_test.py index 9ca1889..60e7ebe 100644 --- a/parsers/commands/run_parser_test.py +++ b/parsers/commands/run_parser_test.py @@ -18,7 +18,7 @@ from click import testing -from google3.third_party.chronicle.cli import mock_test_utility +from mock_test_utility import MockResponse from parsers import url from parsers.commands import run_parser from parsers.tests.fixtures import * # pylint: disable=wildcard-import @@ -47,14 +47,14 @@ def test_run_parser( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, mock_time: mock.MagicMock, - test_data_run_parser: mock_test_utility.MockResponse) -> None: + test_data_run_parser: MockResponse) -> None: """Test case to check success response. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object mock_time (mock.MagicMock): Mock object - test_data_run_parser (mock_test_utility.MockResponse): Test input data + test_data_run_parser (MockResponse): Test input data """ mock_time.return_value = 0.0 create_temp_config_file(TEMP_SUBMIT_CONF_FILE, "test_config") @@ -84,13 +84,13 @@ def test_run_parser( def test_run_parser_v2_flag_not_provided( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_v2flag_not_provided: mock_test_utility.MockResponse) -> None: + test_v2flag_not_provided: MockResponse) -> None: """Test case to check response for v2 flag not provided. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_v2flag_not_provided (mock_test_utility.MockResponse): Test input data + test_v2flag_not_provided (MockResponse): Test input data """ mock_get_dataplane_url.return_value = RUN_URL client = mock.Mock() @@ -108,13 +108,13 @@ def test_run_parser_v2_flag_not_provided( def test_run_parser_empty_project_id( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_empty_project_id: mock_test_utility.MockResponse) -> None: + test_empty_project_id: MockResponse) -> None: """Test case to check response for empty Project ID. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_empty_project_id (mock_test_utility.MockResponse): Test input data + test_empty_project_id (MockResponse): Test input data """ mock_get_dataplane_url.return_value = RUN_URL client = mock.Mock() @@ -133,13 +133,13 @@ def test_run_parser_empty_project_id( def test_run_parser_empty_customer_id( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_empty_customer_id: mock_test_utility.MockResponse) -> None: + test_empty_customer_id: MockResponse) -> None: """Test case to check response for empty Customer ID. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_empty_customer_id (mock_test_utility.MockResponse): Test input data + test_empty_customer_id (MockResponse): Test input data """ mock_get_dataplane_url.return_value = RUN_URL client = mock.Mock() @@ -159,13 +159,13 @@ def test_run_parser_empty_customer_id( def test_run_parser_empty_log_type( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_empty_log_type: mock_test_utility.MockResponse) -> None: + test_empty_log_type: MockResponse) -> None: """Test case to check response for empty Log Type. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_empty_log_type (mock_test_utility.MockResponse): Test input data + test_empty_log_type (MockResponse): Test input data """ mock_get_dataplane_url.return_value = RUN_URL client = mock.Mock() @@ -185,13 +185,13 @@ def test_run_parser_empty_log_type( def test_run_parser_non_existing_config_file( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_data_non_existing_config_file: mock_test_utility.MockResponse) -> None: + test_data_non_existing_config_file: MockResponse) -> None: """Test case to check response for non existing config file. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_data_non_existing_config_file (mock_test_utility.MockResponse): Test + test_data_non_existing_config_file (MockResponse): Test input data """ mock_get_dataplane_url.return_value = RUN_URL @@ -214,13 +214,13 @@ def test_run_parser_non_existing_config_file( def test_run_parser_non_existing_log_file( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_data_non_existing_log_file: mock_test_utility.MockResponse) -> None: + test_data_non_existing_log_file: MockResponse) -> None: """Test case to check response for non existing log file. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_data_non_existing_log_file (mock_test_utility.MockResponse): Test + test_data_non_existing_log_file (MockResponse): Test input data """ create_temp_config_file(TEMP_SUBMIT_CONF_FILE, "test_config") @@ -254,7 +254,7 @@ def test_run_parser_empty_response( mock_get_dataplane_url.return_value = RUN_URL client = mock.Mock() client.request.side_effect = [ - mock_test_utility.MockResponse(status_code=200, text="""{}""") + MockResponse(status_code=200, text="""{}""") ] mock_http_session.return_value = client result = runner.invoke(run_parser.run_parser, [ @@ -274,13 +274,13 @@ def test_run_parser_empty_response( def test_run_parser_500( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_500_resp: mock_test_utility.MockResponse) -> None: + test_500_resp: MockResponse) -> None: """Test case to check response for 500 response code. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_500_resp (mock_test_utility.MockResponse): Test input data + test_500_resp (MockResponse): Test input data """ create_temp_config_file(TEMP_SUBMIT_CONF_FILE, "test_config") create_temp_log_file(TEMP_SUBMIT_LOG_FILE, "test_log1\ntest_log2") diff --git a/parsers/commands/submit_extension_test.py b/parsers/commands/submit_extension_test.py index 6c835a8..cabe99b 100644 --- a/parsers/commands/submit_extension_test.py +++ b/parsers/commands/submit_extension_test.py @@ -18,7 +18,7 @@ from click import testing -from google3.third_party.chronicle.cli import mock_test_utility +from mock_test_utility import MockResponse from parsers import url from parsers.commands import submit_extension from parsers.tests.fixtures import * # pylint: disable=wildcard-import @@ -45,13 +45,13 @@ def test_submit_extension( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_data_submit_extension: mock_test_utility.MockResponse) -> None: + test_data_submit_extension: MockResponse) -> None: """Test case to check success response. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_data_submit_extension (mock_test_utility.MockResponse): Test input data + test_data_submit_extension (MockResponse): Test input data """ create_temp_config_file(TEMP_SUBMIT_CONF_FILE, "test_config") create_temp_log_file(TEMP_SUBMIT_LOG_FILE, "test_log") @@ -93,13 +93,13 @@ def test_submit_extension( def test_submit_extension_v2_flag_not_provided( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_v2flag_not_provided: mock_test_utility.MockResponse) -> None: + test_v2flag_not_provided: MockResponse) -> None: """Test case to check response for v2 flag not provided. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_v2flag_not_provided (mock_test_utility.MockResponse): Test input data + test_v2flag_not_provided (MockResponse): Test input data """ mock_get_dataplane_url.return_value = SUBMIT_URL client = mock.Mock() @@ -117,13 +117,13 @@ def test_submit_extension_v2_flag_not_provided( def test_submit_extension_empty_project_id( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_empty_project_id: mock_test_utility.MockResponse) -> None: + test_empty_project_id: MockResponse) -> None: """Test case to check response for empty Project ID. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_empty_project_id (mock_test_utility.MockResponse): Test input data + test_empty_project_id (MockResponse): Test input data """ mock_get_dataplane_url.return_value = SUBMIT_URL client = mock.Mock() @@ -142,13 +142,13 @@ def test_submit_extension_empty_project_id( def test_submit_extension_empty_customer_id( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_empty_customer_id: mock_test_utility.MockResponse) -> None: + test_empty_customer_id: MockResponse) -> None: """Test case to check response for empty Customer ID. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_empty_customer_id (mock_test_utility.MockResponse): Test input data + test_empty_customer_id (MockResponse): Test input data """ mock_get_dataplane_url.return_value = SUBMIT_URL client = mock.Mock() @@ -168,13 +168,13 @@ def test_submit_extension_empty_customer_id( def test_submit_extension_empty_log_type( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_empty_log_type: mock_test_utility.MockResponse) -> None: + test_empty_log_type: MockResponse) -> None: """Test case to check response for empty Log Type. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_empty_log_type (mock_test_utility.MockResponse): Test input data + test_empty_log_type (MockResponse): Test input data """ mock_get_dataplane_url.return_value = SUBMIT_URL client = mock.Mock() @@ -194,13 +194,13 @@ def test_submit_extension_empty_log_type( def test_submit_extension_non_existing_config_file( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_data_non_existing_config_file: mock_test_utility.MockResponse) -> None: + test_data_non_existing_config_file: MockResponse) -> None: """Test case to check response for non existing config file. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_data_non_existing_config_file (mock_test_utility.MockResponse): Test + test_data_non_existing_config_file (MockResponse): Test input data """ mock_get_dataplane_url.return_value = SUBMIT_URL @@ -222,13 +222,13 @@ def test_submit_extension_non_existing_config_file( def test_submit_extension_non_existing_log_file( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_data_non_existing_log_file: mock_test_utility.MockResponse) -> None: + test_data_non_existing_log_file: MockResponse) -> None: """Test case to check response for non existing log file. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_data_non_existing_log_file (mock_test_utility.MockResponse): Test + test_data_non_existing_log_file (MockResponse): Test input data """ create_temp_config_file(TEMP_SUBMIT_CONF_FILE, "test_config") @@ -251,13 +251,13 @@ def test_submit_extension_non_existing_log_file( def test_submit_extension_500( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_500_resp: mock_test_utility.MockResponse) -> None: + test_500_resp: MockResponse) -> None: """Test case to check response for 500 response code. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_500_resp (mock_test_utility.MockResponse): Test input data + test_500_resp (MockResponse): Test input data """ create_temp_config_file(TEMP_SUBMIT_CONF_FILE, "test_config") create_temp_log_file(TEMP_SUBMIT_LOG_FILE, "test_log") diff --git a/parsers/commands/submit_parser_test.py b/parsers/commands/submit_parser_test.py index 83566f6..179048b 100644 --- a/parsers/commands/submit_parser_test.py +++ b/parsers/commands/submit_parser_test.py @@ -18,7 +18,7 @@ from click import testing -from google3.third_party.chronicle.cli import mock_test_utility +from mock_test_utility import MockResponse from parsers import url from parsers.commands import submit_parser as submit_parser_command from parsers.tests.fixtures import * # pylint: disable=wildcard-import @@ -43,13 +43,13 @@ def test_submit_parser( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_data_submit_parser: mock_test_utility.MockResponse) -> None: + test_data_submit_parser: MockResponse) -> None: """Test case to check success response. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_data_submit_parser (mock_test_utility.MockResponse): Test input data + test_data_submit_parser (MockResponse): Test input data """ create_temp_config_file(TEMP_SUBMIT_CONF_FILE, "test_config") mock_get_dataplane_url.return_value = SUBMIT_URL @@ -97,13 +97,13 @@ def test_submit_parser( def test_submit_parser_skip_validation( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_data_submit_parser: mock_test_utility.MockResponse) -> None: + test_data_submit_parser: MockResponse) -> None: """Test case to check success response. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_data_submit_parser (mock_test_utility.MockResponse): Test input data + test_data_submit_parser (MockResponse): Test input data """ create_temp_config_file(TEMP_SUBMIT_CONF_FILE, "test_config") mock_get_dataplane_url.return_value = SUBMIT_URL @@ -152,13 +152,13 @@ def test_submit_parser_skip_validation( def test_submit_parser_v2_flag_not_provided( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_v2flag_not_provided: mock_test_utility.MockResponse) -> None: + test_v2flag_not_provided: MockResponse) -> None: """Test case to check response for v2 flag not provided. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_v2flag_not_provided (mock_test_utility.MockResponse): Test input data + test_v2flag_not_provided (MockResponse): Test input data """ mock_get_dataplane_url.return_value = SUBMIT_URL client = mock.Mock() @@ -176,13 +176,13 @@ def test_submit_parser_v2_flag_not_provided( def test_submit_parser_empty_project_id( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_empty_project_id: mock_test_utility.MockResponse) -> None: + test_empty_project_id: MockResponse) -> None: """Test case to check response for empty Project ID. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_empty_project_id (mock_test_utility.MockResponse): Test input data + test_empty_project_id (MockResponse): Test input data """ mock_get_dataplane_url.return_value = SUBMIT_URL client = mock.Mock() @@ -201,13 +201,13 @@ def test_submit_parser_empty_project_id( def test_submit_parser_empty_customer_id( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_empty_customer_id: mock_test_utility.MockResponse) -> None: + test_empty_customer_id: MockResponse) -> None: """Test case to check response for empty Customer ID. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_empty_customer_id (mock_test_utility.MockResponse): Test input data + test_empty_customer_id (MockResponse): Test input data """ mock_get_dataplane_url.return_value = SUBMIT_URL client = mock.Mock() @@ -227,13 +227,13 @@ def test_submit_parser_empty_customer_id( def test_submit_parser_empty_log_type( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_empty_log_type: mock_test_utility.MockResponse) -> None: + test_empty_log_type: MockResponse) -> None: """Test case to check response for empty Log Type. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_empty_log_type (mock_test_utility.MockResponse): Test input data + test_empty_log_type (MockResponse): Test input data """ mock_get_dataplane_url.return_value = SUBMIT_URL client = mock.Mock() @@ -253,13 +253,13 @@ def test_submit_parser_empty_log_type( def test_submit_parser_non_existing_config_file( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_data_non_existing_config_file: mock_test_utility.MockResponse) -> None: + test_data_non_existing_config_file: MockResponse) -> None: """Test case to check response for non existing config file. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_data_non_existing_config_file (mock_test_utility.MockResponse): Test + test_data_non_existing_config_file (MockResponse): Test input data """ mock_get_dataplane_url.return_value = SUBMIT_URL @@ -280,13 +280,13 @@ def test_submit_parser_non_existing_config_file( def test_submit_parser_500( mock_get_dataplane_url: mock.MagicMock, mock_http_session: mock.MagicMock, - test_500_resp: mock_test_utility.MockResponse) -> None: + test_500_resp: MockResponse) -> None: """Test case to check response for 500 response code. Args: mock_get_dataplane_url (mock.MagicMock): Mock object mock_http_session (mock.MagicMock): Mock object - test_500_resp (mock_test_utility.MockResponse): Test input data + test_500_resp (MockResponse): Test input data """ create_temp_config_file(TEMP_SUBMIT_CONF_FILE, "test_config") mock_get_dataplane_url.return_value = SUBMIT_URL