Beispiel #1
0
    def test_internal_set_password_twice(self, user, mocker):
        mocker.patch('setpass.api._set_openstack_password', return_value=True)

        pin = user.pin
        api._set_password(user.token, pin, 'new_password')
        with pytest.raises(exception.TokenNotFoundException):
            api._set_password(user.token, pin, 'another_new_password')
Beispiel #2
0
 def test_internal_expired_token(self, user):
     with freezegun.freeze_time(self._get_expired_time(user.updated_at)):
         with pytest.raises(exception.TokenExpiredException):
             api._set_password(user.token, user.pin, 'new_password')
Beispiel #3
0
    def test_internal_wrong_token(self, user):
        wrong_token = 'wrong_token'
        assert wrong_token != user.token

        with pytest.raises(exception.TokenNotFoundException):
            api._set_password(wrong_token, user.pin, 'password2')