aboutsummaryrefslogtreecommitdiffstats
path: root/functest/tests/unit
diff options
context:
space:
mode:
authorCedric Ollivier <cedric.ollivier@orange.com>2018-02-09 16:11:49 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-02-09 16:11:49 +0000
commit81775c2aae62f1f96a54c27eed59cea9f9722de9 (patch)
tree34e454e8c90ef65d4f217928eccf317eb50ed2e8 /functest/tests/unit
parent8073104c142f7e005bba18c96999a11af745fd95 (diff)
parente4e78c6e30132c17266648e8f212694e4f7fc695 (diff)
Merge "Unlink vnf from constants"
Diffstat (limited to 'functest/tests/unit')
-rw-r--r--functest/tests/unit/core/test_vnf.py16
1 files changed, 4 insertions, 12 deletions
diff --git a/functest/tests/unit/core/test_vnf.py b/functest/tests/unit/core/test_vnf.py
index 112ce53b..16a60902 100644
--- a/functest/tests/unit/core/test_vnf.py
+++ b/functest/tests/unit/core/test_vnf.py
@@ -16,7 +16,6 @@ import mock
from functest.core import vnf
from functest.core import testcase
-from functest.utils import constants
from snaps.openstack.os_credentials import OSCreds
@@ -29,9 +28,6 @@ class VnfBaseTesting(unittest.TestCase):
tenant_description = 'description'
def setUp(self):
- constants.CONST.__setattr__("vnf_foo_tenant_name", self.tenant_name)
- constants.CONST.__setattr__(
- "vnf_foo_tenant_description", self.tenant_description)
self.test = vnf.VnfOnBoarding(project='functest', case_name='foo')
def test_run_deploy_orch_exc(self):
@@ -117,8 +113,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=constants.CONST.__getattribute__('env_file'))
+ args[0].assert_called_with(os_env_file=vnf.VnfOnBoarding.env_file)
args[1].assert_not_called()
args[2].assert_not_called()
@@ -128,8 +123,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=constants.CONST.__getattribute__('env_file'))
+ args[0].assert_called_with(os_env_file=vnf.VnfOnBoarding.env_file)
args[1].assert_called_with(mock.ANY, mock.ANY)
args[2].assert_not_called()
@@ -139,8 +133,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=constants.CONST.__getattribute__('env_file'))
+ args[0].assert_called_with(os_env_file=vnf.VnfOnBoarding.env_file)
args[1].assert_called_with(mock.ANY, mock.ANY)
args[2].assert_called_with(mock.ANY, mock.ANY)
@@ -149,8 +142,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=constants.CONST.__getattribute__('env_file'))
+ args[0].assert_called_with(os_env_file=vnf.VnfOnBoarding.env_file)
args[1].assert_called_with(mock.ANY, mock.ANY)
args[2].assert_called_with(mock.ANY, mock.ANY)