示例#1
0
    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'))
示例#2
0
    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'))
示例#3
0
    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"))