aboutsummaryrefslogtreecommitdiffstats
path: root/functest/tests
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2018-02-21 11:33:39 +0100
committerCédric Ollivier <cedric.ollivier@orange.com>2018-02-22 10:31:32 +0100
commitfdbfe10922d09ee3dad407b10be0205082dddce3 (patch)
tree4e9045128181f4683f1918ed7ecebecdacd53387 /functest/tests
parent78a21107e377f4f4722fd8d570dc0394f6ae5692 (diff)
Use constants for Functest config file
env_file can't be defined in a config file simply because it's an entry point (Jenkins jobs, end users) Change-Id: Ie23c0ef90efc839d60f0f3a9754c58746b1f3a00 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/tests')
-rw-r--r--functest/tests/unit/core/test_vnf.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/functest/tests/unit/core/test_vnf.py b/functest/tests/unit/core/test_vnf.py
index 16a60902..0ac672f6 100644
--- a/functest/tests/unit/core/test_vnf.py
+++ b/functest/tests/unit/core/test_vnf.py
@@ -16,6 +16,7 @@ import mock
from functest.core import vnf
from functest.core import testcase
+from functest.utils import constants
from snaps.openstack.os_credentials import OSCreds
@@ -113,7 +114,7 @@ class VnfBaseTesting(unittest.TestCase):
def test_prepare_exc1(self, *args):
with self.assertRaises(Exception):
self.test.prepare()
- args[0].assert_called_with(os_env_file=vnf.VnfOnBoarding.env_file)
+ args[0].assert_called_with(os_env_file=constants.ENV_FILE)
args[1].assert_not_called()
args[2].assert_not_called()
@@ -123,7 +124,7 @@ class VnfBaseTesting(unittest.TestCase):
def test_prepare_exc2(self, *args):
with self.assertRaises(Exception):
self.test.prepare()
- args[0].assert_called_with(os_env_file=vnf.VnfOnBoarding.env_file)
+ args[0].assert_called_with(os_env_file=constants.ENV_FILE)
args[1].assert_called_with(mock.ANY, mock.ANY)
args[2].assert_not_called()
@@ -133,7 +134,7 @@ class VnfBaseTesting(unittest.TestCase):
def test_prepare_exc3(self, *args):
with self.assertRaises(Exception):
self.test.prepare()
- args[0].assert_called_with(os_env_file=vnf.VnfOnBoarding.env_file)
+ args[0].assert_called_with(os_env_file=constants.ENV_FILE)
args[1].assert_called_with(mock.ANY, mock.ANY)
args[2].assert_called_with(mock.ANY, mock.ANY)
@@ -142,7 +143,7 @@ class VnfBaseTesting(unittest.TestCase):
@mock.patch('snaps.openstack.tests.openstack_tests.get_credentials')
def test_prepare_default(self, *args):
self.assertEqual(self.test.prepare(), testcase.TestCase.EX_OK)
- args[0].assert_called_with(os_env_file=vnf.VnfOnBoarding.env_file)
+ args[0].assert_called_with(os_env_file=constants.ENV_FILE)
args[1].assert_called_with(mock.ANY, mock.ANY)
args[2].assert_called_with(mock.ANY, mock.ANY)