API update (#128)

* adding support for api fields that can be disabled and have default value at the same time

Signed-off-by: Tomas Herfert <herfik>

* api path support: interface gre

Signed-off-by: Tomas Herfert <herfik>

* docs

Signed-off-by: Tomas Herfert <herfik>

* unit test update & yamlling fix

Signed-off-by: Tomas Herfert <herfik>

* test fix

Signed-off-by: Tomas Herfert <herfik>

* sanity fix

Signed-off-by: Tomas Herfert <herfik>

* changelog

Signed-off-by: Tomas Herfert <herfik>

* Update per suggestion

Co-authored-by: Felix Fontein <felix@fontein.de>

* api path support: interface eoip

Signed-off-by: Tomas Herfert <herfik>

* docs

Signed-off-by: Tomas Herfert <herfik>

* apply suggestion from code review

Signed-off-by: Tomas Herfert <herfik>

Signed-off-by: Tomas Herfert <herfik>
Co-authored-by: Tomas Herfert <herfik>
Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
Tomas Herfert 2022-11-17 12:48:50 +01:00 committed by GitHub
parent 1353055fe2
commit 23b3aa3beb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 73 additions and 6 deletions

View file

@ -63,11 +63,19 @@ def test_key_info_errors():
('can_disable', True),
]
params_allowed_together = [
'default',
'can_disable',
]
emsg = 'required, default, automatically_computed_from, and can_disable are mutually exclusive besides default and can_disable which can be set together'
for index, (param, param_value) in enumerate(values):
for param2, param2_value in values[index + 1:]:
if param in params_allowed_together and param2 in params_allowed_together:
continue
with pytest.raises(ValueError) as exc:
KeyInfo(**{param: param_value, param2: param2_value})
assert exc.value.args[0] == 'required, default, automatically_computed_from, and can_disable are mutually exclusive'
assert exc.value.args[0] == emsg
with pytest.raises(ValueError) as exc:
KeyInfo('foo')