<s> from rally . common import junit <EOL> from tests . unit import test <EOL> class JUnitTestCase ( test . TestCase ) : <EOL> def test_basic_testsuite ( self ) : <EOL> j = junit . JUnit ( "<STR_LIT:test>" ) <EOL> j . add_test ( "<STR_LIT>" , <NUM_LIT> , outcome = junit . JUnit . SUCCESS ) <EOL> j . add_test ( "<STR_LIT>" , <NUM_LIT> , outcome = junit . JUnit . FAILURE , <EOL> message = "<STR_LIT>" ) <EOL> j . add_test ( "<STR_LIT>" , <NUM_LIT> , outcome = junit . JUnit . ERROR ) <EOL> expected = """<STR_LIT>""" <EOL> self . assertEqual ( expected . replace ( "<STR_LIT:\n>" , "<STR_LIT>" ) , j . to_xml ( ) ) <EOL> def test_empty_testsuite ( self ) : <EOL> j = junit . JUnit ( "<STR_LIT:test>" ) <EOL> expected = """<STR_LIT>""" <EOL> self . assertEqual ( expected . replace ( "<STR_LIT:\n>" , "<STR_LIT>" ) , j . to_xml ( ) ) <EOL> def test_invalid_outcome ( self ) : <EOL> j = junit . JUnit ( "<STR_LIT:test>" ) <EOL> self . assertRaises ( ValueError , j . add_test , "<STR_LIT>" , <NUM_LIT> , <EOL> outcome = <NUM_LIT> ) </s>
