1111# under the License.
1212#
1313
14+ import mock
15+
1416from openstackclient .common import configuration
1517from openstackclient .tests import fakes
1618from openstackclient .tests import utils
@@ -33,7 +35,12 @@ class TestConfiguration(utils.TestCommand):
3335 fakes .REGION_NAME ,
3436 )
3537
36- def test_show (self ):
38+ opts = [mock .Mock (secret = True , dest = "password" ),
39+ mock .Mock (secret = True , dest = "token" )]
40+
41+ @mock .patch ("keystoneauth1.loading.base.get_plugin_options" ,
42+ return_value = opts )
43+ def test_show (self , m_get_plugin_opts ):
3744 arglist = []
3845 verifylist = [('mask' , True )]
3946 cmd = configuration .ShowConfiguration (self .app , None )
@@ -44,7 +51,9 @@ def test_show(self):
4451 self .assertEqual (self .columns , columns )
4552 self .assertEqual (self .datalist , data )
4653
47- def test_show_unmask (self ):
54+ @mock .patch ("keystoneauth1.loading.base.get_plugin_options" ,
55+ return_value = opts )
56+ def test_show_unmask (self , m_get_plugin_opts ):
4857 arglist = ['--unmask' ]
4958 verifylist = [('mask' , False )]
5059 cmd = configuration .ShowConfiguration (self .app , None )
@@ -62,7 +71,9 @@ def test_show_unmask(self):
6271 )
6372 self .assertEqual (datalist , data )
6473
65- def test_show_mask (self ):
74+ @mock .patch ("keystoneauth1.loading.base.get_plugin_options" ,
75+ return_value = opts )
76+ def test_show_mask (self , m_get_plugin_opts ):
6677 arglist = ['--mask' ]
6778 verifylist = [('mask' , True )]
6879 cmd = configuration .ShowConfiguration (self .app , None )
0 commit comments