def test_user_verify_password(self, mock): ''' Test if it verify a user's password ''' mock = MagicMock(return_value='http://127.0.0.1:35357/v2.0') with patch.dict(keystone.__salt__, {'config.option': mock}): self.assertDictEqual(keystone.user_verify_password(), {'Error': 'Unable to resolve user name'}) self.assertTrue( keystone.user_verify_password(user_id='446', name='nova')) MockClient.flag = 1 self.assertFalse( keystone.user_verify_password(user_id='446', name='nova'))
def test_user_verify_password(self, mock): ''' Test if it verify a user's password ''' mock = MagicMock(return_value='http://127.0.0.1:35357/v2.0') with patch.dict(keystone.__salt__, {'config.option': mock}): self.assertDictEqual(keystone.user_verify_password(), {'Error': 'Unable to resolve user name'}) self.assertTrue(keystone.user_verify_password(user_id='446', name='nova')) MockClient.flag = 1 self.assertFalse(keystone.user_verify_password(user_id='446', name='nova'))
def test_user_verify_password(self): """ Test if it verify a user's password """ mock = MagicMock(return_value="http://127.0.0.1:35357/v2.0") with patch.dict(keystone.__salt__, {"config.option": mock}): self.assertDictEqual( keystone.user_verify_password(), {"Error": "Unable to resolve user name"}, ) self.assertTrue( keystone.user_verify_password(user_id="446", name="nova")) MockClient.flag = 1 self.assertFalse( keystone.user_verify_password(user_id="446", name="nova"))