示例#1
0
文件: test_core.py 项目: perfa/py-x
    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"))
示例#2
0
文件: test_core.py 项目: perfa/py-x
    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"))
示例#3
0
文件: test_core.py 项目: perfa/py-x
 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_(""))
示例#4
0
文件: test_core.py 项目: perfa/py-x
 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"))
示例#5
0
文件: test_core.py 项目: perfa/py-x
 def test_should_generate_xml_node_with_testcase_tag(self):
     test = XunitTest("test")
     xml = test.to_xml()
     assert_that(xml.tag, is_("testcase"))
示例#6
0
文件: test_core.py 项目: perfa/py-x
 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"))
示例#7
0
文件: test_core.py 项目: perfa/py-x
 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_(""))