Change config validator tests to use the shared fixtures

This commit is contained in:
Joseph Schorr 2017-04-24 14:52:30 -04:00
parent 7debd44b54
commit cb3695a629
17 changed files with 59 additions and 117 deletions

View file

@ -6,12 +6,13 @@ from util.morecollections import AttrDict
from test.test_keystone_auth import fake_keystone
from test.fixtures import *
@pytest.mark.parametrize('unvalidated_config', [
({}),
({'AUTHENTICATION_TYPE': 'Database'}),
])
def test_validate_noop(unvalidated_config):
def test_validate_noop(unvalidated_config, app):
KeystoneValidator.validate(unvalidated_config, None, None)
@pytest.mark.parametrize('unvalidated_config', [
@ -22,7 +23,7 @@ def test_validate_noop(unvalidated_config):
({'AUTHENTICATION_TYPE': 'Keystone', 'KEYSTONE_AUTH_URL': 'foo',
'KEYSTONE_ADMIN_USERNAME': 'bar', 'KEYSTONE_ADMIN_PASSWORD': 'baz'}),
])
def test_invalid_config(unvalidated_config):
def test_invalid_config(unvalidated_config, app):
with pytest.raises(ConfigValidationException):
KeystoneValidator.validate(unvalidated_config, None, None)
@ -33,7 +34,7 @@ def test_invalid_config(unvalidated_config):
('invaliduser', 'somepass', ConfigValidationException),
('cool.user', 'password', None),
])
def test_validated_keystone(username, password, expected_exception):
def test_validated_keystone(username, password, expected_exception, app):
with fake_keystone(2) as keystone_auth:
auth_url = keystone_auth.auth_url