I want to test function calls with optional arguments.
Here is my code:
list_get()
list_get(key, "city", 0)
list_get(key, 'contact_no', 2, {}, policy)
list_get(key, "contact_no", 0)
list_get(key, "contact_no", 1, {}, policy, "")
list_get(key, "contact_no", 0, 888)
I am not able to parametrize it due to optional arguments, so I have written separate test functions for each api call in pytest
.
I believe there should be better way of testing this one.