From 6994d11f06a61c0eb162b193a25a0ed1432c5d56 Mon Sep 17 00:00:00 2001 From: Adam McDonagh <27215476+adammcdonagh@users.noreply.github.com> Date: Mon, 3 Jun 2024 17:47:31 +0000 Subject: [PATCH] Rename variable cacheing module to vc_ssm --- .../variablecaching/aws/{ssm.py => vc_ssm.py} | 2 +- tests/test_cacheable_variable_ssm.py | 12 ++++++------ ...st_taskhandler_transfer_dummy_with_ssm_caching.py | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) rename src/opentaskpy/variablecaching/aws/{ssm.py => vc_ssm.py} (99%) diff --git a/src/opentaskpy/variablecaching/aws/ssm.py b/src/opentaskpy/variablecaching/aws/vc_ssm.py similarity index 99% rename from src/opentaskpy/variablecaching/aws/ssm.py rename to src/opentaskpy/variablecaching/aws/vc_ssm.py index 4bdc0dc..9b84d7b 100644 --- a/src/opentaskpy/variablecaching/aws/ssm.py +++ b/src/opentaskpy/variablecaching/aws/vc_ssm.py @@ -9,7 +9,7 @@ logger = opentaskpy.otflogging.init_logging(__name__) -CACHE_NAME = "ssm" +CACHE_NAME = "vc_ssm" def run(**kwargs): # type: ignore[no-untyped-def] diff --git a/tests/test_cacheable_variable_ssm.py b/tests/test_cacheable_variable_ssm.py index 039c211..a0c8680 100644 --- a/tests/test_cacheable_variable_ssm.py +++ b/tests/test_cacheable_variable_ssm.py @@ -4,20 +4,20 @@ from botocore.exceptions import ClientError from opentaskpy.exceptions import CachingPluginError -from opentaskpy.variablecaching.aws import ssm +from opentaskpy.variablecaching.aws import vc_ssm from tests.fixtures.localstack import * # noqa: F403 def test_cacheable_variable_ssm_args(): # Test combinations of the plugin with invalid args with pytest.raises(CachingPluginError): - ssm.run() + vc_ssm.run() with pytest.raises(CachingPluginError): - ssm.run(name="/test/variable") + vc_ssm.run(name="/test/variable") with pytest.raises(CachingPluginError): - ssm.run(value="newvalue") + vc_ssm.run(value="newvalue") def test_cacheable_variable_ssm(ssm_client): @@ -36,7 +36,7 @@ def test_cacheable_variable_ssm(ssm_client): kwargs = {"name": f"/test/variable", "value": "newvalue"} - ssm.run(**kwargs) + vc_ssm.run(**kwargs) # Check the variable has content of "newvalue" assert ( @@ -57,4 +57,4 @@ def test_cacheable_variable_ssm_failure(ssm_client): del os.environ["AWS_ENDPOINT_URL"] with pytest.raises(ClientError): - ssm.run(**kwargs) + vc_ssm.run(**kwargs) diff --git a/tests/test_taskhandler_transfer_dummy_with_ssm_caching.py b/tests/test_taskhandler_transfer_dummy_with_ssm_caching.py index ce3eaf6..704507c 100644 --- a/tests/test_taskhandler_transfer_dummy_with_ssm_caching.py +++ b/tests/test_taskhandler_transfer_dummy_with_ssm_caching.py @@ -3,7 +3,7 @@ from opentaskpy.taskhandlers import transfer -from opentaskpy.variablecaching.aws import ssm +from opentaskpy.variablecaching.aws import vc_ssm from tests.fixtures.localstack import * # noqa: F403 dummy_task_definition = { @@ -15,7 +15,7 @@ "cacheableVariables": [ { "variableName": "accessToken", - "cachingPlugin": "aws.ssm", + "cachingPlugin": "aws.vc_ssm", "cacheArgs": { "name": "/test/variablename", },