mirror of
https://github.com/ansible-collections/community.routeros.git
synced 2025-06-23 02:08:47 +02:00
Add regexp field to ip dns static (#142)
* Add regexp field to "ip dns static" * Change test_invalid_required_missing to use "ip dhcp-server" "ip dns static" requires name or regexp so it cannot be used in this test. * Add required_one_of attribute to APIData Used by "ip dns static" which requires either "name" or "regexp. * Add mutually_exclusive attribute to APIData Used by "ip dns static" where only one of "name" or "regexp" can be used. * Add changelog fragment
This commit is contained in:
parent
62da7dd4e3
commit
586edbc211
5 changed files with 98 additions and 4 deletions
|
@ -54,6 +54,22 @@ def test_api_data_errors():
|
|||
APIData(stratify_keys=['foo'], fields={})
|
||||
assert exc.value.args[0] == 'Stratify key foo must be in fields!'
|
||||
|
||||
with pytest.raises(ValueError) as exc:
|
||||
APIData(required_one_of=['foo'], fields={})
|
||||
assert exc.value.args[0] == 'Require one of element at index #1 must be a list!'
|
||||
|
||||
with pytest.raises(ValueError) as exc:
|
||||
APIData(required_one_of=[['foo']], fields={})
|
||||
assert exc.value.args[0] == 'Require one of key foo must be in fields!'
|
||||
|
||||
with pytest.raises(ValueError) as exc:
|
||||
APIData(mutually_exclusive=['foo'], fields={})
|
||||
assert exc.value.args[0] == 'Mutually exclusive element at index #1 must be a list!'
|
||||
|
||||
with pytest.raises(ValueError) as exc:
|
||||
APIData(mutually_exclusive=[['foo']], fields={})
|
||||
assert exc.value.args[0] == 'Mutually exclusive key foo must be in fields!'
|
||||
|
||||
|
||||
def test_key_info_errors():
|
||||
values = [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue