from ._test_utils import get_context_with_patch_api_and_cloud
from steps.api.utils import try_read_from_variable, try_save_value_to_variable
[docs]
def test_context():
get_context_with_patch_api_and_cloud()
[docs]
def test_temporary_variable():
context = get_context_with_patch_api_and_cloud()
assert context.cloud.temp == {}
try_save_value_to_variable(context, 'test_value', "temporary variable \"test_key\"")
assert try_read_from_variable("temporary variable \"test_key\"", context) == 'test_value'
[docs]
def test_user_variables():
context = get_context_with_patch_api_and_cloud()
assert try_read_from_variable("variable \"first_name\" of user 0", context) == 'Marie'
assert try_read_from_variable("variable \"last_name\" of user 0", context) == 'de Gournay'
assert try_read_from_variable("variable \"first_name\" of user 1", context) == 'Anne-Josèphe'
assert try_read_from_variable("variable \"last_name\" of user 1", context) == 'Théroigne de Méricourt'
[docs]
def test_admin_variables():
context = get_context_with_patch_api_and_cloud()
assert try_read_from_variable("variable \"email\" of admin", context) == 'qa@quandela.com'
[docs]
def test_env_variable():
context = get_context_with_patch_api_and_cloud()
assert try_read_from_variable("environnement variable \"PATCH_OPEN_API\"", context)