summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCedric Ollivier <cedric.ollivier@orange.com>2018-02-12 16:03:26 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-02-12 16:03:26 +0000
commit7598ab763d31ca4f901043722c19635b73f00d3f (patch)
tree8a3e4e3d7e0b259b4a4c3bebfbbd8dc2cb2def5a
parente94f6195fb4116fb4228a6c3e600d073de3b6109 (diff)
parent8d83b91049f4b2f3da6b77d39105a2213a8ce690 (diff)
Merge "Export env vars via os.environ in test_cli_env.py"
-rw-r--r--functest/tests/unit/cli/commands/test_cli_env.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/functest/tests/unit/cli/commands/test_cli_env.py b/functest/tests/unit/cli/commands/test_cli_env.py
index e5c409bf4..883772348 100644
--- a/functest/tests/unit/cli/commands/test_cli_env.py
+++ b/functest/tests/unit/cli/commands/test_cli_env.py
@@ -8,13 +8,13 @@
# pylint: disable=missing-docstring
import logging
+import os
import re
import unittest
import mock
from functest.cli.commands import cli_env
-from functest.utils.constants import CONST
class RegexMatch(object): # pylint: disable=too-few-public-methods
@@ -34,22 +34,22 @@ class CliEnvTesting(unittest.TestCase):
def _test_show_missing_env_var(self, var, *args):
# pylint: disable=unused-argument
if var == 'INSTALLER_TYPE':
- CONST.__setattr__('INSTALLER_TYPE', None)
+ os.environ['INSTALLER_TYPE'] = ''
reg_string = r"| INSTALLER: Unknown, \S+\s*|"
elif var == 'INSTALLER_IP':
- CONST.__setattr__('INSTALLER_IP', None)
+ os.environ['INSTALLER_IP'] = ''
reg_string = r"| INSTALLER: \S+, Unknown\s*|"
elif var == 'SCENARIO':
- CONST.__setattr__('DEPLOY_SCENARIO', None)
+ os.environ['DEPLOY_SCENARIO'] = ''
reg_string = r"| SCENARIO: Unknown\s*|"
elif var == 'NODE':
- CONST.__setattr__('NODE_NAME', None)
+ os.environ['NODE_NAME'] = ''
reg_string = r"| POD: Unknown\s*|"
elif var == 'BUILD_TAG':
- CONST.__setattr__('BUILD_TAG', None)
+ os.environ['BUILD_TAG'] = ''
reg_string = r"| BUILD TAG: None|"
elif var == 'DEBUG':
- CONST.__setattr__('CI_DEBUG', None)
+ os.environ['CI_DEBUG'] = ''
reg_string = r"| DEBUG FLAG: false\s*|"
with mock.patch('functest.cli.commands.cli_env.click.echo') \