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>
pull/70664/head
Rick Elrod 4 years ago committed by GitHub
parent 02c63ec285
commit 8455bc6838
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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…
Cancel
Save