File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33from subprocess import check_output , run
44from unittest import TestCase
55from unittest .mock import ANY , create_autospec , patch , Mock
6+ from xml .etree import ElementTree
67
78from robot .running .model import TestSuite
89
@@ -54,10 +55,18 @@ def test_junit_works_on_cli(self):
5455 text = True ,
5556 shell = True )
5657
57- for expected in ('<stat pass="69" fail="3">Critical Tests</stat>' ,
58- '<stat pass="69" fail="3">All Tests</stat>' ):
59- self .assertIn (expected , example .read_text ())
60- self .assertIn (expected , actual .read_text ())
58+ exampleTree = ElementTree .parse (example )
59+ exampleRoot = exampleTree .getroot ()
60+
61+ actualTree = ElementTree .parse (actual )
62+ actualRoot = actualTree .getroot ()
63+
64+ exampleStat = exampleRoot .find (
65+ './statistics/total//stat[.="All Tests"]' )
66+ actualStat = actualRoot .find ('./statistics/total//stat[.="All Tests"]' )
67+
68+ self .assertEqual (exampleStat .get ('pass' ), actualStat .get ('pass' ))
69+ self .assertEqual (exampleStat .get ('fail' ), actualStat .get ('fail' ))
6170
6271
6372class TestOxygenCLI (TestCase ):
You can’t perform that action at this time.
0 commit comments