From 2b702661f3bd9b79de887e82e5a5925d07341eb6 Mon Sep 17 00:00:00 2001 From: jasquat Date: Fri, 21 Oct 2022 16:46:41 -0400 Subject: [PATCH] Squashed 'spiffworkflow-backend/' changes from b978f502..797c99a7 797c99a7 updated uses of normalize value to check prefixes in tests w/ burnettk c169cbd9 updated lock file w/ burnettk git-subtree-dir: spiffworkflow-backend git-subtree-split: 797c99a76e9e03e6b78157876b1ac0d503f13b95 --- poetry.lock | 10 ++++++---- .../services/service_task_service.py | 2 +- .../unit/test_service_task_delegate.py | 18 +++++++++--------- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/poetry.lock b/poetry.lock index 2d1802051..b14dfa7eb 100644 --- a/poetry.lock +++ b/poetry.lock @@ -618,7 +618,7 @@ description = "Flask Bpmn" category = "main" optional = false python-versions = "^3.7" -develop = true +develop = false [package.dependencies] click = "^8.0.1" @@ -636,8 +636,10 @@ spiffworkflow = "*" werkzeug = "*" [package.source] -type = "directory" -url = "../flask-bpmn" +type = "git" +url = "https://github.com/sartography/flask-bpmn" +reference = "main" +resolved_reference = "c7e2f98d1c42e3ff90a989957a346f4f87e622b8" [[package]] name = "Flask-Cors" @@ -2246,7 +2248,7 @@ testing = ["flake8 (<5)", "func-timeout", "jaraco.functools", "jaraco.itertools" [metadata] lock-version = "1.1" python-versions = ">=3.9,<3.11" -content-hash = "3cb512700b37e2b156cea3d607d2264f49811cce17fa94ba473d91781c92117d" +content-hash = "5c08dfcad4346a47966aec0ca7198d6d85eddd3d3673e059f367d6c4845738c5" [metadata.files] alabaster = [ diff --git a/src/spiffworkflow_backend/services/service_task_service.py b/src/spiffworkflow_backend/services/service_task_service.py index a5a6d4b63..97c879965 100644 --- a/src/spiffworkflow_backend/services/service_task_service.py +++ b/src/spiffworkflow_backend/services/service_task_service.py @@ -23,7 +23,7 @@ class ServiceTaskDelegate: @staticmethod def check_prefixes(value: Any) -> Any: - + """Check_prefixes.""" if isinstance(value, str): secret_prefix = "secret:" # noqa: S105 if value.startswith(secret_prefix): diff --git a/tests/spiffworkflow_backend/unit/test_service_task_delegate.py b/tests/spiffworkflow_backend/unit/test_service_task_delegate.py index b0022a5df..95b557560 100644 --- a/tests/spiffworkflow_backend/unit/test_service_task_delegate.py +++ b/tests/spiffworkflow_backend/unit/test_service_task_delegate.py @@ -9,25 +9,25 @@ from spiffworkflow_backend.services.service_task_service import ServiceTaskDeleg class TestServiceTaskDelegate(BaseTest): """TestServiceTaskDelegate.""" - def test_normalize_value_without_secret( + def test_check_prefixes_without_secret( self, app: Flask, with_db_and_bpmn_file_cleanup: None ) -> None: - """Test_normalize_value_without_secret.""" - result = ServiceTaskDelegate.normalize_value("hey") + """Test_check_prefixes_without_secret.""" + result = ServiceTaskDelegate.check_prefixes("hey") assert result == "hey" - def test_normalize_value_with_int( + def test_check_prefixes_with_int( self, app: Flask, with_db_and_bpmn_file_cleanup: None ) -> None: - """Test_normalize_value_with_int.""" - result = ServiceTaskDelegate.normalize_value(1) + """Test_check_prefixes_with_int.""" + result = ServiceTaskDelegate.check_prefixes(1) assert result == 1 - def test_normalize_value_with_secret( + def test_check_prefixes_with_secret( self, app: Flask, with_db_and_bpmn_file_cleanup: None ) -> None: - """Test_normalize_value_with_secret.""" + """Test_check_prefixes_with_secret.""" user = self.find_or_create_user("test_user") SecretService().add_secret("hot_secret", "my_secret_value", user.id) - result = ServiceTaskDelegate.normalize_value("secret:hot_secret") + result = ServiceTaskDelegate.check_prefixes("secret:hot_secret") assert result == "my_secret_value"