Change config validator tests to use the shared fixtures
This commit is contained in:
parent
7debd44b54
commit
cb3695a629
17 changed files with 59 additions and 117 deletions
|
@ -4,13 +4,15 @@ import pytest
|
|||
from util.config.validators import ConfigValidationException
|
||||
from util.config.validators.validate_storage import StorageValidator
|
||||
|
||||
from test.fixtures import *
|
||||
|
||||
@pytest.mark.parametrize('unvalidated_config, expected', [
|
||||
({}, ConfigValidationException),
|
||||
({'DISTRIBUTED_STORAGE_CONFIG': {}}, ConfigValidationException),
|
||||
({'DISTRIBUTED_STORAGE_CONFIG': {'local': None}}, ConfigValidationException),
|
||||
({'DISTRIBUTED_STORAGE_CONFIG': {'local': ['FakeStorage', {}]}}, None),
|
||||
])
|
||||
def test_validate_storage(unvalidated_config, expected):
|
||||
def test_validate_storage(unvalidated_config, expected, app):
|
||||
validator = StorageValidator()
|
||||
if expected is not None:
|
||||
with pytest.raises(expected):
|
||||
|
@ -18,7 +20,7 @@ def test_validate_storage(unvalidated_config, expected):
|
|||
else:
|
||||
validator.validate(unvalidated_config, None, None)
|
||||
|
||||
def test_validate_s3_storage():
|
||||
def test_validate_s3_storage(app):
|
||||
validator = StorageValidator()
|
||||
with moto.mock_s3():
|
||||
with pytest.raises(ConfigValidationException) as ipe:
|
||||
|
|
Reference in a new issue