diff options
author | Deepak S <deepak.s@linux.intel.com> | 2017-06-20 14:31:19 -0700 |
---|---|---|
committer | Ross Brattain <ross.b.brattain@intel.com> | 2017-08-08 08:54:23 -0700 |
commit | 5ce3b6f8c8b3217091e51a6041455738603d90b8 (patch) | |
tree | ca34e15a85d69e2b23ce498fead47761624ae42c /tests/unit/apiserver/__init__.py | |
parent | 72778951d6b8968f562fb8fefa02a57159ea1b83 (diff) |
NSB update
Refactored main NSB VNF classes accroding to class diagram
https://wiki.opnfv.org/display/yardstick/NSB+class+diagram
All the SampleVNFs have been separated and placed under
the SampleVNF class.
Added AutoConnectSSH to automatically create SSH conneciton on demand.
Added VnfdHelper class to wrap the VNFD dictionary in prepartion for
class-based modeling.
Extracted DpdkVnfSetupEnvHelper for DPDK based VNF setup.
Extracted Stats and other client config to ResourceHelper
Had to replace dict_key_flatten with deepgetitem due to Python 2.7
Jinja2 infinite recursion.
Change-Id: Ia8840e9c44cdbdf39aab6b02e6d2176b31937dc9
Signed-off-by: Deepak S <deepak.s@linux.intel.com>
Signed-off-by: Edward MacGillivray <edward.s.macgillivray@intel.com>
Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
Diffstat (limited to 'tests/unit/apiserver/__init__.py')
-rw-r--r-- | tests/unit/apiserver/__init__.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/unit/apiserver/__init__.py b/tests/unit/apiserver/__init__.py index 021415296..1c9d5a672 100644 --- a/tests/unit/apiserver/__init__.py +++ b/tests/unit/apiserver/__init__.py @@ -1,6 +1,7 @@ from __future__ import absolute_import import os +import socket import unittest import tempfile @@ -14,7 +15,12 @@ class APITestCase(unittest.TestCase): def setUp(self): self.db_fd, self.db_path = tempfile.mkstemp() consts.SQLITE = 'sqlite:///{}'.format(self.db_path) - from api import server + + try: + from api import server + except socket.gaierror: + self.app = None + return server.app.config['TESTING'] = True self.app = server.app.test_client() |