From 5c81cd61c096e4fa2aba0845909a81cc783c416e Mon Sep 17 00:00:00 2001 From: SeSo Date: Tue, 24 Dec 2024 11:23:55 -0800 Subject: [PATCH] chore: revert unrelated commit This reverts commit 8b72bf9c9997120d60eae5a86c2f092a07978ebd. --- .../auth/test_endpoint_permissions.py | 20 ++----------------- 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/bc_obps/common/tests/endpoints/auth/test_endpoint_permissions.py b/bc_obps/common/tests/endpoints/auth/test_endpoint_permissions.py index c54a6f104a..b1f0e6aa5d 100644 --- a/bc_obps/common/tests/endpoints/auth/test_endpoint_permissions.py +++ b/bc_obps/common/tests/endpoints/auth/test_endpoint_permissions.py @@ -410,7 +410,7 @@ def test_endpoint_permissions_by_role( mock_check_permission_for_role.reset_mock() @classmethod - def get_all_api_endpoints_to_test(cls): + def test_all_api_endpoints_are_permission_tested(cls): # these are the endpoints that we don't want to test exclusion_list = [ "api-root", @@ -430,23 +430,7 @@ def get_all_api_endpoints_to_test(cls): "get_fuel_data", ] all_url_patterns = get_resolver().url_patterns[1].url_patterns # index 1 is the API route - return [pattern.name for pattern in all_url_patterns if pattern.name not in exclusion_list] - - @classmethod - def test_endpoint_protections_by_role( - cls, - # mock_check_permission_for_role: MagicMock, - ): - valid_urls = cls.get_all_api_endpoints_to_test() - print(valid_urls) - for role, configs in cls.endpoints_to_test.items(): - for config in configs: - print(role, config) - - @classmethod - def test_all_api_endpoints_are_permission_tested(cls): - valid_urls = cls.get_all_api_endpoints_to_test() - + valid_urls = [pattern.name for pattern in all_url_patterns if pattern.name not in exclusion_list] # Flatten endpoints_to_test to extract all endpoint names that are permission-tested tested_endpoints = { item["endpoint_name"] for role, configs in cls.endpoints_to_test.items() for item in configs