tests.system.providers.amazon.aws.utils

Package Contents

Functions

fetch_variable(key, default_value = None)

Given a Parameter name: first check for an existing Environment Variable,

set_env_id()

Retrieves or generates an Environment ID, validate that it is suitable,

Attributes

ENV_ID_ENVIRON_KEY

DEFAULT_ENV_ID_PREFIX

DEFAULT_ENV_ID_LEN

DEFAULT_ENV_ID

TEST_FILE_IDENTIFIER

INVALID_ENV_ID_MSG

LOWERCASE_ENV_ID_MSG

NO_VALUE_MSG

tests.system.providers.amazon.aws.utils.ENV_ID_ENVIRON_KEY :str = SYSTEM_TESTS_ENV_ID[source]
tests.system.providers.amazon.aws.utils.DEFAULT_ENV_ID_PREFIX :str = env[source]
tests.system.providers.amazon.aws.utils.DEFAULT_ENV_ID_LEN :int = 8[source]
tests.system.providers.amazon.aws.utils.DEFAULT_ENV_ID :str[source]
tests.system.providers.amazon.aws.utils.TEST_FILE_IDENTIFIER :str = example[source]
tests.system.providers.amazon.aws.utils.INVALID_ENV_ID_MSG :str = In order to maximize compatibility, the SYSTEM_TESTS_ENV_ID must be an alphanumeric string which...[source]
tests.system.providers.amazon.aws.utils.LOWERCASE_ENV_ID_MSG :str = The provided Environment ID contains uppercase letters and will be converted to lowercase for...[source]
tests.system.providers.amazon.aws.utils.NO_VALUE_MSG :str = No Value Found: Variable {key} could not be found and no default value was provided.[source]
tests.system.providers.amazon.aws.utils.fetch_variable(key, default_value=None)[source]

Given a Parameter name: first check for an existing Environment Variable, then check SSM for a value. If neither are available, fall back on the optional default value.

Parameters
  • key (str) -- The name of the Parameter to fetch a value for.

  • default_value (Optional[str]) -- The default value to use if no value can be found.

Returns

The value of the parameter.

Return type

str

tests.system.providers.amazon.aws.utils.set_env_id()[source]

Retrieves or generates an Environment ID, validate that it is suitable, export it as an Environment Variable, and return it.

If an Environment ID has already been generated, use that. Otherwise, try to fetch it and export it as an Environment Variable. If there is not one available to fetch then generate one and export it as an Environment Variable.

Returns

A valid System Test Environment ID.

Return type

str

Was this entry helpful?