# Assert documentation and possibilities

**URL:** <https://forum.ansible.com/t/assert-documentation-and-possibilities/34469>\
**Category:** Ansible Project\
**Tags:** galaxy-ng\
**Created:** [January 19, 2021, 2:20pm UTC](https://forum.ansible.com/t/assert-documentation-and-possibilities/34469 "2021-01-19T14:20:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amjad\_Saleem1](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@Amjad\_Saleem1](https://forum.ansible.com/u/Amjad_Saleem1)\
**Post date:** [January 19, 2021, 2:20pm UTC](https://forum.ansible.com/t/assert-documentation-and-possibilities/34469/1 "2021-01-19T14:20:17Z")

</div>

Sorry for newbie question but I cannot find any information on what can be done with assert. For example, going through ansible modules in galaxy, I found that you can do something like ‘var is number’ to test that var is integer and not string. Where can I found documentation on what can be done with assert eg is there something like ‘var2 is email’. So the basic question is, where can I find supported tests for assert?

Thanks

---

<div class="post-metadata">

**Author:** ![Andrew\_Latham](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@Andrew\_Latham](https://forum.ansible.com/u/Andrew_Latham)\
**Post date:** [January 19, 2021, 2:47pm UTC](https://forum.ansible.com/t/assert-documentation-and-possibilities/34469/2 "2021-01-19T14:47:31Z")

</div>

It is documented at [https://docs.ansible.com/ansible/latest/user\_guide/playbooks\_conditionals.html](https://docs.ansible.com/ansible/latest/user_guide/playbooks_conditionals.html) and conditionals is the search term you wanted.

---

<div class="post-metadata">

**Author:** ![vbotka](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/vbotka/32/359_2.png) [@vbotka](https://forum.ansible.com/u/vbotka)\
**Post date:** [January 19, 2021, 3:13pm UTC](https://forum.ansible.com/t/assert-documentation-and-possibilities/34469/3 "2021-01-19T15:13:16Z")

</div>

Use Ansible tests  
[https://docs.ansible.com/ansible/latest/user\_guide/playbooks\_tests.html](https://docs.ansible.com/ansible/latest/user_guide/playbooks_tests.html)

and Jinja tests  
[https://jinja.palletsprojects.com/en/master/templates/#list-of-builtin-tests](https://jinja.palletsprojects.com/en/master/templates/#list-of-builtin-tests)

In addition to this, you can write tests on your own  
[https://docs.ansible.com/ansible/latest/dev\_guide/developing\_plugins.html#test-plugins](https://docs.ansible.com/ansible/latest/dev_guide/developing_plugins.html#test-plugins)

---

<div class="post-metadata">

**Author:** ![Amjad\_Saleem1](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@Amjad\_Saleem1](https://forum.ansible.com/u/Amjad_Saleem1)\
**Post date:** [January 19, 2021, 3:30pm UTC](https://forum.ansible.com/t/assert-documentation-and-possibilities/34469/4 "2021-01-19T15:30:39Z")

</div>

Thanks Andrew and Vladimir. That’s very helpful.
