Move registry storage validator to new location
This commit is contained in:
parent
b2afe68632
commit
ee4f5ed5d6
3 changed files with 62 additions and 38 deletions
18
util/config/validators/test/test_registrystorage.py
Normal file
18
util/config/validators/test/test_registrystorage.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
import pytest
|
||||
|
||||
from util.config.validators import ConfigValidationException
|
||||
from util.config.validators.registrystorage import StorageValidator
|
||||
|
||||
@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):
|
||||
validator = StorageValidator()
|
||||
if expected is not None:
|
||||
with pytest.raises(expected):
|
||||
validator.validate(unvalidated_config, None, None)
|
||||
else:
|
||||
validator.validate(unvalidated_config, None, None)
|
Reference in a new issue