---
- name: "{{ parser }} Violate argspec"
  ansible.netcommon.cli_parse:
    text: ""
    parser:
      name: ansible.netcommon.native
      template_path: ""
      command: show interface
  register: argfail
  ignore_errors: true

- name: "{{ parser }} Check argspec fail"
  assert:
    that: "argfail['msg'] == 'parameters are mutually exclusive: command|template_path found in parser'"

- name: "{{ parser }} Violate argspec"
  ansible.netcommon.cli_parse:
    text: ""
    command: show interface
    parser:
      name: ansible.netcommon.native
      command: ""
  register: argfail
  ignore_errors: true

- name: "{{ parser }} Check argspec fail"
  assert:
    that: "argfail['msg'] == 'parameters are mutually exclusive: command|text'"

- name: "{{ parser }} Violate argspec"
  ansible.netcommon.cli_parse:
    parser:
      name: ansible.netcommon.native
      command: ""
  register: argfail
  ignore_errors: true

- name: "{{ parser }} Check argspec fail"
  assert:
    that: "argfail['msg'] == 'one of the following is required: command, text'"


- name: "{{ parser }} Violate argspec"
  ansible.netcommon.cli_parse:
    text: ""
    parser:
      name: not_fqdn
      command: ""
  register: argfail
  ignore_errors: true

- name: "{{ parser }} Check arspec fail"
  assert:
    that: "argfail['msg'] == 'Parser name should be provided as a full name including collection'"
