Пример #1
0
 def test_name_when_test_suites(self):
     sub1 = MockSuite('SubSuite1')
     sub2 = MockSuite('SubSuite2')
     suite = MockSuite('Suite1', suites = [sub1, sub2])
     tree_suite = tree.SuiteTreeItem(suite)
     self.assertEquals(tree_suite.label, 'Suite1')
     self.assertEquals(tree_suite.children[0].label, 'SubSuite1')
     self.assertEquals(tree_suite.children[1].label, 'SubSuite2')
Пример #2
0
 def test_collapse_all_suites_with_one_sub_suite_with_one_test_leaf(self):
     test1 = MockTest('Test1')
     subsub1 = MockSuite('SubSubSuite1', tests=[test1])
     sub1 = MockSuite('SubSuite1', suites=[subsub1])
     suite = MockSuite('Suite1', suites = [sub1])
     tree_suite = tree.SuiteTreeItem(suite)
     self.assertEquals(tree_suite.label, 'Suite1/SubSuite1')
     self.assertEquals(tree_suite.children[0].label, 'SubSubSuite1')
     self.assertEquals(tree_suite.children[0].children[0].label, 'Test1')
Пример #3
0
 def test_collapse_all_suites_with_one_sub_suite_with_one_test_leaf_and_one_non_visible_test_leaf(self):
     test1 = MockTest('Test1')
     subsub1 = MockSuite('SubSubSuite1', tests=[test1])
     sub1 = MockSuite('SubSuite1', suites=[subsub1])
     test2 = MockTest('Test2', visible=False)
     subsub2 = MockSuite('SubSubSuite2', visible=False, tests=[test2])
     sub2 = MockSuite('SubSuite2', visible=False, suites=[subsub2])
     suite = MockSuite('Suite1', suites = [sub1, sub2])
     tree_suite = tree.SuiteTreeItem(suite)
     self.assertEquals(tree_suite.label, 'Suite1/SubSuite1')
     self.assertEquals(tree_suite.children[0].label, 'SubSubSuite1')
     self.assertEquals(len(tree_suite.children), 1)
     self.assertEquals(len(tree_suite.children[0].children), 1)
Пример #4
0
 def test_name_when_test_cases(self):
     test1 = MockTest('Test1')
     test2 = MockTest('Test2')
     suite = MockSuite('Suite1', tests = [test1, test2])
     tree_suite = tree.SuiteTreeItem(suite)
     self.assertEquals(tree_suite.label, 'Suite1')
Пример #5
0
 def test_simple_suite_name(self):
     suite = MockSuite('Suite')
     tree_suite = tree.SuiteTreeItem(suite)
     self.assertEquals(tree_suite.label, 'Suite')
Пример #6
0
 def test_get_icon_names_with_dir_suite(self):
     subsuite = MockSuite('SubSuite')
     suite = MockSuite('Suite', suites=[subsuite])
     tree_suite = tree.SuiteTreeItem(suite)
     self.assertEquals(tree_suite.GetIconName(), 'dir_suite')
Пример #7
0
 def test_get_icon_names_with_file_suite(self):
     test = MockTest('Test')
     suite = MockSuite('Suite', tests=[test])
     tree_suite = tree.SuiteTreeItem(suite)
     self.assertEquals(tree_suite.GetIconName(), 'file_suite')