mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-23 19:01:26 -07:00
Add descriptive error message to Linode inventory plugin file checkin… (#8133)
* Add descriptive error message to Linode inventory plugin file checking, tests * add changelog fragment * Adjust changelog fragment. --------- Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
795a855d0e
commit
b389f8637f
3 changed files with 37 additions and 7 deletions
|
@ -37,11 +37,25 @@ def test_missing_access_token_lookup(inventory):
|
|||
assert 'Could not retrieve Linode access token' in error_message
|
||||
|
||||
|
||||
def test_verify_file(tmp_path, inventory):
|
||||
def test_verify_file_yml(tmp_path, inventory):
|
||||
file = tmp_path / "foobar.linode.yml"
|
||||
file.touch()
|
||||
assert inventory.verify_file(str(file)) is True
|
||||
|
||||
|
||||
def test_verify_file_yaml(tmp_path, inventory):
|
||||
file = tmp_path / "foobar.linode.yaml"
|
||||
file.touch()
|
||||
assert inventory.verify_file(str(file)) is True
|
||||
|
||||
|
||||
def test_verify_file_bad_config_yml(inventory):
|
||||
assert inventory.verify_file("foobar.linode.yml") is False
|
||||
|
||||
|
||||
def test_verify_file_bad_config_yaml(inventory):
|
||||
assert inventory.verify_file("foobar.linode.yaml") is False
|
||||
|
||||
|
||||
def test_verify_file_bad_config(inventory):
|
||||
assert inventory.verify_file('foobar.linode.yml') is False
|
||||
assert inventory.verify_file("foobar.wrongcloud.yml") is False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue