def test_is_empty_xml_none_result(self): """ Given - A result from qualys When - result is None Then - return true """ response = None assert is_empty_result(response)
def test_is_empty_xml_only_datetime(self): """ Given - A json parsed result from qualys When - result has only datetime key Then - return true since result has no content """ response = {'DATETIME': 'sometime'} res = is_empty_result(response) assert res
def test_is_empty_xml_non_empty_result(self): """ Given - A json parsed result from qualys When - result has some keys Then - return false since result has content """ response = {'IP_SET': {'IP': ['1.1.1.1']}, 'DATETIME': 'sometime'} res = is_empty_result(response) assert not res
def test_is_empty_xml_empty_input(self): """ Given - A json parsed result from qualys When - result has no keys Then - return true since result is empty """ reponse = {} res = is_empty_result(reponse) assert res