Patch default credentials when executing command unit tests.
Change-Id: I9cc69082ee3da64be83f53c5be12f656af606951
This commit is contained in:
parent
0117ddac81
commit
086ad8fc15
|
@ -18,6 +18,7 @@ import os.path
|
|||
|
||||
from tobiko.cmd import base
|
||||
from tobiko.tests.unit import TobikoUnitTest
|
||||
from tobiko.openstack import keystone
|
||||
|
||||
|
||||
class TobikoCMDTest(TobikoUnitTest):
|
||||
|
@ -25,6 +26,20 @@ class TobikoCMDTest(TobikoUnitTest):
|
|||
command_name = None
|
||||
command_class = base.TobikoCMD
|
||||
|
||||
default_credentials = keystone.keystone_credentials(
|
||||
api_version=3,
|
||||
auth_url='http://127.0.0.1:5000/identiy/v3',
|
||||
username='demo',
|
||||
project_name='demo',
|
||||
password='this is a secret',
|
||||
user_domain_name='Default',
|
||||
project_domain_name='Default')
|
||||
|
||||
def setUp(self):
|
||||
TobikoUnitTest.setUp(self)
|
||||
self.patch('tobiko.openstack.keystone.default_keystone_credentials',
|
||||
return_value=self.default_credentials)
|
||||
|
||||
def test_init(self, argv=None):
|
||||
self.patch_argv(argv=argv)
|
||||
cmd = self.command_class()
|
||||
|
|
Loading…
Reference in New Issue