def test_parse_xml_2(self) : try : testXMLFile = "crises/test_data/WorldCrises_bad_root.xml" xml = read_and_validate_xml(testXMLFile) model = parse_xml (xml) assert(False) except : assert(True)
def test_parse_xml_3(self) : try : testXMLFile = "" xml = read_and_validate_xml(testXMLFile) model = parse_xml (xml) assert(False) except : assert(True)
def test_parse_xml_1(self) : testXMLFile = "crises/test_data/WorldCrises_good.xml" xml = read_and_validate_xml(testXMLFile) model = parse_xml (xml) assert(len(model["crises"])==1) assert(type(model["crises"]["CRI_NRINFL"]) is Crisis) assert(len(model["people"])==1) assert(type(model["people"]["PER_MNSNGH"]) is Person) assert(len(model["orgs"])==1) assert(type(model["orgs"]["ORG_PMRLFD"]) is Organization)