66
77
88class TestTestspaceReportXsd :
9+ testsuite_list = ['z testsuite' ,
10+ '1 testsuite' ,
11+ 'Example Suite' ,
12+ 'A test suite' ,
13+ 'aa test suite' ]
14+
915 annotation_tuple = [
1016 ('zannotation warning example' , 'warn' , 'to confirm order of annotations' ),
1117 ('annotation info example' , 'info' , 'description of annotation' ),
@@ -23,6 +29,9 @@ class TestTestspaceReportXsd:
2329 def setup_class (cls ):
2430 testspace_report = testspace_xml .TestspaceReport ()
2531
32+ for suite in cls .testsuite_list :
33+ testspace_report .add_test_suite (suite )
34+
2635 example_suite = testspace_report .get_or_add_test_suite ('Example Suite' )
2736 example_suite .add_link_annotation (path = 'https://help.testspace.com' )
2837 example_suite .add_string_buffer_annotation (
@@ -78,12 +87,17 @@ def teardown_class(cls):
7887 os .remove ('testspace.xml' )
7988
8089 def test_number_testsuites (self ):
81- test_cases = self .testspace_xml_root .xpath ("//test_suite" )
82- assert len (test_cases ) is 1
90+ test_suites = self .testspace_xml_root .xpath ("//test_suite" )
91+ assert len (test_suites ) is 5
92+
93+ def test_testsuites_order (self ):
94+ test_suites = self .testspace_xml_root .xpath ("//test_suite" )
95+ for idx , tests_suite in enumerate (test_suites ):
96+ assert tests_suite .get ('name' ) == self .testsuite_list [idx ]
8397
8498 def test_number_testsuite_annotations (self ):
85- test_cases = self .testspace_xml_root .xpath ("//test_suite/annotation" )
86- assert len (test_cases ) is 5
99+ test_suites = self .testspace_xml_root .xpath ("//test_suite/annotation" )
100+ assert len (test_suites ) is 5
87101
88102 def test_testsuite_duration (self ):
89103 suite_element = self .testspace_xml_root .xpath ("//test_suite[@duration]" )
@@ -125,7 +139,8 @@ def test_annotation_order(self):
125139 assert annotation .get ('name' ) == self .annotation_tuple [idx ][0 ]
126140
127141 def test_testcase_duration (self ):
128- suite_element = self .testspace_xml_root .xpath ("//test_suite/test_case[@name='passing case 2']" )
142+ suite_element = self .testspace_xml_root .xpath (
143+ "//test_suite/test_case[@name='passing case 2']" )
129144 assert float (suite_element [0 ].attrib ['duration' ]) == self .duration
130145
131146 def test_validate_xsd (self ):
0 commit comments