def test_should_reporttime_in_xml_as_time_attribute(self): test = XunitTest("test") xml = test.to_xml() assert_that(xml.attrib['time'], is_("0.0")) test = XunitTest("test", time=4.4) xml = test.to_xml() assert_that(xml.attrib['time'], is_("4.4"))
def test_should_report_test_name_in_xml_as_name_attribute(self): test = XunitTest("test") xml = test.to_xml() assert_that(xml.attrib['name'], is_("test")) test = XunitTest("Nescobar_aloplop") xml = test.to_xml() assert_that(xml.attrib['name'], is_("Nescobar_aloplop"))
def test_should_create_error_node_with_message_in_xml_if_error_test(self): test = XunitTest("test", error=True) xml = test.to_xml() assert_that(xml[0].tag, is_("error")) assert_that(xml[0].attrib['message'], is_(""))
def test_should_report_test_class_in_xml_as_class_attribute(self): test = XunitTest("test", class_name="TestObject") xml = test.to_xml() assert_that(xml.attrib['classname'], is_("TestObject"))
def test_should_generate_xml_node_with_testcase_tag(self): test = XunitTest("test") xml = test.to_xml() assert_that(xml.tag, is_("testcase"))
def test_should_create_skipped_node_with_message_in_xml_if_skipped_test(self): test = XunitTest("test", skipped=True) xml = test.to_xml() assert_that(xml[0].tag, is_("skipped"))
def test_should_create_failure_node_with_message_in_xml_if_failed_test(self): test = XunitTest("test", failed=True) xml = test.to_xml() assert_that(xml[0].tag, is_("failure")) assert_that(xml[0].attrib['message'], is_(""))