1111# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
1212# License for the specific language governing permissions and limitations
1313# under the License.
14- #
15-
16- from unittest import mock
1714
1815from openstackclient .identity .v3 import token
1916from openstackclient .tests .unit .identity .v3 import fakes as identity_fakes
2017
2118
22- class TestToken (identity_fakes .TestIdentityv3 ):
23- def setUp (self ):
24- super ().setUp ()
25-
26- # Get a shortcut to the Auth Ref Mock
27- self .ar_mock = mock .PropertyMock ()
28- type(self .app .client_manager ).auth_ref = self .ar_mock
29-
30-
31- class TestTokenIssue (TestToken ):
19+ class TestTokenIssue (identity_fakes .TestIdentityv3 ):
3220 def setUp (self ):
3321 super ().setUp ()
3422
@@ -38,8 +26,7 @@ def test_token_issue_with_project_id(self):
3826 auth_ref = identity_fakes .fake_auth_ref (
3927 identity_fakes .TOKEN_WITH_PROJECT_ID ,
4028 )
41- self .ar_mock = mock .PropertyMock (return_value = auth_ref )
42- type(self .app .client_manager ).auth_ref = self .ar_mock
29+ self .app .client_manager .auth_ref = auth_ref
4330
4431 arglist = []
4532 verifylist = []
@@ -64,8 +51,7 @@ def test_token_issue_with_domain_id(self):
6451 auth_ref = identity_fakes .fake_auth_ref (
6552 identity_fakes .TOKEN_WITH_DOMAIN_ID ,
6653 )
67- self .ar_mock = mock .PropertyMock (return_value = auth_ref )
68- type(self .app .client_manager ).auth_ref = self .ar_mock
54+ self .app .client_manager .auth_ref = auth_ref
6955
7056 arglist = []
7157 verifylist = []
@@ -90,8 +76,7 @@ def test_token_issue_with_unscoped(self):
9076 auth_ref = identity_fakes .fake_auth_ref (
9177 identity_fakes .UNSCOPED_TOKEN ,
9278 )
93- self .ar_mock = mock .PropertyMock (return_value = auth_ref )
94- type(self .app .client_manager ).auth_ref = self .ar_mock
79+ self .app .client_manager .auth_ref = auth_ref
9580
9681 arglist = []
9782 verifylist = []
@@ -114,7 +99,7 @@ def test_token_issue_with_unscoped(self):
11499 self .assertEqual (datalist , data )
115100
116101
117- class TestTokenRevoke (TestToken ):
102+ class TestTokenRevoke (identity_fakes . TestIdentityv3 ):
118103 TOKEN = 'fob'
119104
120105 def setUp (self ):
0 commit comments