mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-27 23:21:22 -07:00
[PR #8133/b389f863 backport][stable-7] Add descriptive error message to Linode inventory plugin file checkin… (#8143)
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>
(cherry picked from commit b389f8637f
)
Co-authored-by: Gideon <soccerman.gid@gmail.com>
This commit is contained in:
parent
baeae01797
commit
8927dc777a
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