Skip to content

Commit

Permalink
Rename variable cacheing module to vc_ssm
Browse files Browse the repository at this point in the history
  • Loading branch information
adammcdonagh authored Jun 3, 2024
1 parent 3d9ec6a commit 6994d11
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
12 changes: 6 additions & 6 deletions tests/test_cacheable_variable_ssm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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 (
Expand All @@ -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)
4 changes: 2 additions & 2 deletions tests/test_taskhandler_transfer_dummy_with_ssm_caching.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -15,7 +15,7 @@
"cacheableVariables": [
{
"variableName": "accessToken",
"cachingPlugin": "aws.ssm",
"cachingPlugin": "aws.vc_ssm",
"cacheArgs": {
"name": "/test/variablename",
},
Expand Down

0 comments on commit 6994d11

Please sign in to comment.