Code Review
/
yardstick.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge "test_kubernetes: mock file operations in test_ssh_key"
[yardstick.git]
/
tests
/
unit
/
apiserver
/
__init__.py
diff --git
a/tests/unit/apiserver/__init__.py
b/tests/unit/apiserver/__init__.py
index
0214152
..
1c9d5a6
100644
(file)
--- a/
tests/unit/apiserver/__init__.py
+++ b/
tests/unit/apiserver/__init__.py
@@
-1,6
+1,7
@@
from __future__ import absolute_import
import os
from __future__ import absolute_import
import os
+import socket
import unittest
import tempfile
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)
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()
server.app.config['TESTING'] = True
self.app = server.app.test_client()