mercredi 13 février 2019

Test assert is none in Python currently gives Unresolved Reference error

How do I check if a json resonse does not contain a key?

I have a json response that may or may not contain a hostname key. I'd like to to test that it is not present in a particular scenario.

I tried assertIsNone(hostname) based what I read in the unittest documentation but it gives a ``Unresolved Reference` error.

Is there any way I can do this test?

Aucun commentaire:

Enregistrer un commentaire