mirror of
https://github.com/ansible/awx.git
synced 2026-03-29 06:45:09 -02:30
Merge pull request #6902 from ryanpetrello/fix-3508
Support AWX_TASK_ENV injection in task and notification invocations.
This commit is contained in:
@@ -2,7 +2,9 @@
|
||||
|
||||
# Copyright (c) 2017 Ansible, Inc.
|
||||
# All Rights Reserved.
|
||||
import os
|
||||
import pytest
|
||||
from uuid import uuid4
|
||||
|
||||
from awx.main.utils import common
|
||||
|
||||
@@ -15,3 +17,13 @@ from awx.main.utils import common
|
||||
])
|
||||
def test_parse_yaml_or_json(input_, output):
|
||||
assert common.parse_yaml_or_json(input_) == output
|
||||
|
||||
|
||||
def test_set_environ():
|
||||
key = str(uuid4())
|
||||
old_environ = os.environ.copy()
|
||||
with common.set_environ(**{key: 'bar'}):
|
||||
assert os.environ[key] == 'bar'
|
||||
assert set(os.environ.keys()) - set(old_environ.keys()) == set([key])
|
||||
assert os.environ == old_environ
|
||||
assert key not in os.environ
|
||||
|
||||
Reference in New Issue
Block a user