def test_should_create_xml_that_is_valid_according_to_the_JUnit_jenkins_schema(self): test = XunitTest("test1") suite = XunitSuite("suite1") suite.append(test) result = Xunit() result.append(suite) try: xml = etree.fromstring(result.to_string(), PARSER) except etree.XMLSyntaxError as err: print(str(err)) self.fail("Should have parsed without errors") else: pass
def test_should_stringify_into_proper_xml_document(self): result = Xunit() xml = result.to_string() assert_that(xml, contains_string('<?xml version="1.0" encoding="UTF-8"?>'))