def test_success_junit_xml(test_name, class_name='Results', testcase_name='test_ran'):
 testsuite = ET.Element('testsuite')
 testsuite.set('tests', '1')
 testsuite.set('failures', '0')
 testsuite.set('time', '1')
 testsuite.set('errors', '0')
 testsuite.set('name', test_name)
 testcase = ET.SubElement(testsuite, 'testcase')
 testcase.set('name', testcase_name)
 testcase.set('status', 'run')
 testcase.set('time', '1')
 testcase.set('classname', class_name)
 return ET.tostring(testsuite, encoding='utf-8', method='xml')

def test_success_junit_xml ( test_name , class_name = 'Results' , testcase_name = 'test_ran' ) : testsuite = ET . Element ( 'testsuite' ) testsuite . set ( 'tests' , '1' ) testsuite . set ( 'failures' , '0' ) testsuite . set ( 'time' , '1' ) testsuite . set ( 'errors' , '0' ) testsuite . set ( 'name' , test_name ) testcase = ET . SubElement ( testsuite , 'testcase' ) testcase . set ( 'name' , testcase_name ) testcase . set ( 'status' , 'run' ) testcase . set ( 'time' , '1' ) testcase . set ( 'classname' , class_name ) return ET . tostring ( testsuite , encoding = 'utf-8' , method = 'xml' )
generate junit xml file for a unary test suite where the test succeeded .