Some more coverage for csvfile (#70661)
* Some more coverage for csvfile Change: - Add a few tests Test Plan: - CI, new tests Signed-off-by: Rick Elrod <rick@elrod.me>
This commit is contained in:
parent
02c63ec285
commit
8455bc6838
1 changed files with 15 additions and 0 deletions
|
@ -3,12 +3,27 @@
|
|||
ignore_errors: yes
|
||||
register: no_keyword
|
||||
|
||||
- set_fact:
|
||||
this_will_error: "{{ lookup('csvfile', 'foo file=people.csv delimiter=, col=1 thisarg=doesnotexist') }}"
|
||||
ignore_errors: yes
|
||||
register: invalid_arg
|
||||
|
||||
- set_fact:
|
||||
this_will_error: "{{ lookup('csvfile', 'foo file=doesnotexist delimiter=, col=1') }}"
|
||||
ignore_errors: yes
|
||||
register: missing_file
|
||||
|
||||
- name: Make sure we failed above
|
||||
assert:
|
||||
that:
|
||||
- no_keyword is failed
|
||||
- >
|
||||
"Search key is required but was not found" in no_keyword.msg
|
||||
- >
|
||||
"not in paramvals" in invalid_arg.msg
|
||||
- missing_file is failed
|
||||
- >
|
||||
"need string or buffer" in missing_file.msg or "expected str, bytes or os.PathLike object" in missing_file.msg
|
||||
|
||||
- name: Check basic comma-separated file
|
||||
assert:
|
||||
|
|
Loading…
Reference in a new issue