def test_should_create_testsuite_tag_if_only_one_testsuite_registered(self): suite = suite_mock() result = Xunit(suite) xml = result.to_xml() suite.to_xml.assert_called_once() assert_that(xml, is_(suite.to_xml()))
def test_should_force_package_inclusion_when_converting_multiple_suites_to_xml(self): result = Xunit() suite = suite_mock() result.append(suite) result.append(suite_mock()) xml = result.to_xml() suite.to_xml.assert_called_once_with(force_package=True, id=0)
def test_should_create_testsuites_root_tag_if_more_than_one_testsuite_registered(self): result = Xunit() result.append(suite_mock()) result.append(suite_mock()) xml = result.to_xml() assert_that(xml.tag, is_("testsuites")) assert_that([child for child in xml], has_length(2))
def test_should_give_each_suite_an_id_when_converting_multiple_suites_to_xml(self): result = Xunit() suite = suite_mock() suite2 = suite_mock() result.append(suite) result.append(suite2) xml = result.to_xml() suite.to_xml.assert_called_once_with(force_package=True, id=0) suite2.to_xml.assert_called_once_with(force_package=True, id=1)