|
|
|
|
@ -37,9 +37,14 @@ def test_environment_variables():
|
|
|
|
|
{"name": "var4", "value": 3.14, "id": str(uuid4()), "selector": ["env", "var4"]}
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# Mock current_user as an EndUser
|
|
|
|
|
mock_user = mock.Mock()
|
|
|
|
|
mock_user.tenant_id = "tenant_id"
|
|
|
|
|
|
|
|
|
|
with (
|
|
|
|
|
mock.patch("core.helper.encrypter.encrypt_token", return_value="encrypted_token"),
|
|
|
|
|
mock.patch("core.helper.encrypter.decrypt_token", return_value="secret"),
|
|
|
|
|
mock.patch("models.workflow.current_user", mock_user),
|
|
|
|
|
):
|
|
|
|
|
# Set the environment_variables property of the Workflow instance
|
|
|
|
|
variables = [variable1, variable2, variable3, variable4]
|
|
|
|
|
@ -79,9 +84,14 @@ def test_update_environment_variables():
|
|
|
|
|
{"name": "var4", "value": 3.14, "id": str(uuid4()), "selector": ["env", "var4"]}
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# Mock current_user as an EndUser
|
|
|
|
|
mock_user = mock.Mock()
|
|
|
|
|
mock_user.tenant_id = "tenant_id"
|
|
|
|
|
|
|
|
|
|
with (
|
|
|
|
|
mock.patch("core.helper.encrypter.encrypt_token", return_value="encrypted_token"),
|
|
|
|
|
mock.patch("core.helper.encrypter.decrypt_token", return_value="secret"),
|
|
|
|
|
mock.patch("models.workflow.current_user", mock_user),
|
|
|
|
|
):
|
|
|
|
|
variables = [variable1, variable2, variable3, variable4]
|
|
|
|
|
|
|
|
|
|
@ -120,9 +130,14 @@ def test_to_dict():
|
|
|
|
|
|
|
|
|
|
# Create some EnvironmentVariable instances
|
|
|
|
|
|
|
|
|
|
# Mock current_user as an EndUser
|
|
|
|
|
mock_user = mock.Mock()
|
|
|
|
|
mock_user.tenant_id = "tenant_id"
|
|
|
|
|
|
|
|
|
|
with (
|
|
|
|
|
mock.patch("core.helper.encrypter.encrypt_token", return_value="encrypted_token"),
|
|
|
|
|
mock.patch("core.helper.encrypter.decrypt_token", return_value="secret"),
|
|
|
|
|
mock.patch("models.workflow.current_user", mock_user),
|
|
|
|
|
):
|
|
|
|
|
# Set the environment_variables property of the Workflow instance
|
|
|
|
|
workflow.environment_variables = [
|
|
|
|
|
|