"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "keystone/tests/unit/test_validation.py" between
keystone-17.0.0.tar.gz and keystone-18.0.0.tar.gz

About: OpenStack Keystone (Core Service: Identity) provides an authentication and authorization service for other OpenStack services. Provides a catalog of endpoints for all OpenStack services.
The "Victoria" series (latest release).

test_validation.py  (keystone-17.0.0):test_validation.py  (keystone-18.0.0)
skipping to change at line 2498 skipping to change at line 2498
self.assertRaises(exception.SchemaValidationError, self.assertRaises(exception.SchemaValidationError,
self.authorize_request_token_validator.validate, self.authorize_request_token_validator.validate,
request_to_validate) request_to_validate)
class PasswordValidationTestCase(unit.TestCase): class PasswordValidationTestCase(unit.TestCase):
def setUp(self): def setUp(self):
super(PasswordValidationTestCase, self).setUp() super(PasswordValidationTestCase, self).setUp()
# passwords requires: 1 letter, 1 digit, 7 chars # passwords requires: 1 letter, 1 digit, 7 chars
self.config_fixture.config(group='security_compliance', self.config_fixture.config(group='security_compliance',
password_regex=( password_regex=(
'^(?=.*\d)(?=.*[a-zA-Z]).{7,}$')) r'^(?=.*\d)(?=.*[a-zA-Z]).{7,}$'))
def test_password_validate_with_valid_strong_password(self): def test_password_validate_with_valid_strong_password(self):
password = 'mypassword2' password = 'mypassword2'
validators.validate_password(password) validators.validate_password(password)
def test_password_validate_with_invalid_strong_password(self): def test_password_validate_with_invalid_strong_password(self):
# negative test: None # negative test: None
password = None password = None
self.assertRaises(exception.PasswordValidationError, self.assertRaises(exception.PasswordValidationError,
validators.validate_password, validators.validate_password,
skipping to change at line 2524 skipping to change at line 2524
password) password)
# negative test: boolean # negative test: boolean
password = True password = True
self.assertRaises(exception.PasswordValidationError, self.assertRaises(exception.PasswordValidationError,
validators.validate_password, validators.validate_password,
password) password)
def test_password_validate_with_invalid_password_regex(self): def test_password_validate_with_invalid_password_regex(self):
# invalid regular expression, missing beginning '[' # invalid regular expression, missing beginning '['
self.config_fixture.config(group='security_compliance', self.config_fixture.config(group='security_compliance',
password_regex='\S]+') password_regex=r'\S]+')
password = 'mypassword2' password = 'mypassword2'
self.assertRaises(exception.PasswordValidationError, self.assertRaises(exception.PasswordValidationError,
validators.validate_password, validators.validate_password,
password) password)
# fix regular expression and validate # fix regular expression and validate
self.config_fixture.config(group='security_compliance', self.config_fixture.config(group='security_compliance',
password_regex='[\S]+') password_regex=r'[\S]+')
validators.validate_password(password) validators.validate_password(password)
class LimitValidationTestCase(unit.BaseTestCase): class LimitValidationTestCase(unit.BaseTestCase):
"""Test for V3 Limits API validation.""" """Test for V3 Limits API validation."""
def setUp(self): def setUp(self):
super(LimitValidationTestCase, self).setUp() super(LimitValidationTestCase, self).setUp()
create_registered_limits = limit_schema.registered_limit_create create_registered_limits = limit_schema.registered_limit_create
update_registered_limits = limit_schema.registered_limit_update update_registered_limits = limit_schema.registered_limit_update
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)