def test_get_indicators(self): err = "Output from Demisto didn't match the expected output" from StixParser import get_indicators stix_input, expected_output = _get_stix() stix_input = stix_input.get("objects") output_dict, stix_objects = get_indicators(stix_input) assert output_dict == expected_output[0], err assert stix_objects.get("8.8.8.8").get("pattern") == "[domain-name:value = 'ip-8-8-8-8']", err
def test_get_indicators_dict(self): from StixParser import get_indicators stix_input, expected_output = _get_stix_little() output, _ = get_indicators(stix_input[0]) output_url = output.get("URL") expected_url = expected_output[0].get("URL") assert output_url == expected_url, "Output from Demisto didn't match the expected output\nExpected: {} \n " \ "Got: {}".format(expected_url, output_url )