def test_filter_cases(self):
     modules = ['oetag', 'data']
     expected_cases = {'data.DataTest.testDataOk',
                       'oetag.TagTest.testTagGood'}
     tc = self._testLoader(modules=modules, tests=expected_cases)
     cases = set(getSuiteCasesIDs(tc.suites))
     msg = 'Expected just %s cases' % ', '.join(expected_cases)
     self.assertEqual(cases, expected_cases, msg=msg)
 def test_filter_cases(self):
     modules = ['oetag', 'data']
     expected_cases = {'data.DataTest.testDataOk',
                       'oetag.TagTest.testTagGood'}
     tc = self._testLoader(modules=modules, tests=expected_cases)
     cases = set(getSuiteCasesIDs(tc.suites))
     msg = 'Expected just %s cases' % ', '.join(expected_cases)
     self.assertEqual(cases, expected_cases, msg=msg)
 def test_depends_order(self):
     tests =  ['depends.DependsTest.testDependsFirst',
               'depends.DependsTest.testDependsSecond',
               'depends.DependsTest.testDependsThird',
               'depends.DependsTest.testDependsFourth',
               'depends.DependsTest.testDependsFifth']
     tests2 = list(tests)
     tests2[2], tests2[3] = tests[3], tests[2]
     tc = self._testLoader(modules=self.modules, tests=tests)
     test_loaded = getSuiteCasesIDs(tc.suites)
     result = True if test_loaded == tests or test_loaded == tests2 else False
     msg = 'Failed to order tests using OETestDepends decorator.\nTest order:'\
           ' %s.\nExpected:   %s\nOr:         %s' % (test_loaded, tests, tests2)
     self.assertTrue(result, msg=msg)
 def test_depends_order(self):
     tests =  ['depends.DependsTest.testDependsFirst',
               'depends.DependsTest.testDependsSecond',
               'depends.DependsTest.testDependsThird',
               'depends.DependsTest.testDependsFourth',
               'depends.DependsTest.testDependsFifth']
     tests2 = list(tests)
     tests2[2], tests2[3] = tests[3], tests[2]
     tc = self._testLoader(modules=self.modules, tests=tests)
     test_loaded = getSuiteCasesIDs(tc.suites)
     result = True if test_loaded == tests or test_loaded == tests2 else False
     msg = 'Failed to order tests using OETestDepends decorator.\nTest order:'\
           ' %s.\nExpected:   %s\nOr:         %s' % (test_loaded, tests, tests2)
     self.assertTrue(result, msg=msg)
 def _runTest(self, modules, filterfn, expect):
     tc = self._testLoader(modules = modules, tags_filter = filterfn)
     test_loaded = set(getSuiteCasesIDs(tc.suites))
     self.assertEqual(expect, test_loaded)