Make test cases test_crypto.py from NoDBTestCase

No need to access db for crypto test cases, this patch
mocked one db access and make all others inherit from
NoDBTestCase.

Change-Id: Ie8f49b7139a0a95bf39f3978af9cf3f992543b39
This commit is contained in:
jichenjc 2015-10-07 04:20:33 +08:00
parent 38c3f883db
commit 5f8047e686
1 changed files with 3 additions and 2 deletions

View File

@ -32,8 +32,9 @@ from nova import test
from nova import utils
class X509Test(test.TestCase):
def test_can_generate_x509(self):
class X509Test(test.NoDBTestCase):
@mock.patch('nova.db.certificate_create')
def test_can_generate_x509(self, mock_create):
with utils.tempdir() as tmpdir:
self.flags(ca_path=tmpdir)
crypto.ensure_ca_filesystem()