def test_multiply_tests_by_their_scenarios(self):
     loader = TestLoader()
     suite = loader.suiteClass()
     test_instance = PretendVaryingTest('test_nothing')
     multiply_tests_by_their_scenarios(test_instance, suite)
     self.assertEqual(['a', 'a', 'b', 'b'],
                      get_generated_test_attributes(suite, 'value'))
Esempio n. 2
0
def test_suite():
    from unittest import TestSuite
    from bzrlib.tests import TestLoader
    suite = TestSuite()
    loader = TestLoader()
    testmod_names = [ 'test_classify']
    suite.addTest(loader.loadTestsFromModuleNames(['%s.%s' % (__name__, i) for i in testmod_names]))
    return suite
Esempio n. 3
0
 def test_multiply_tests_by_their_scenarios(self):
     loader = TestLoader()
     suite = loader.suiteClass()
     test_instance = PretendVaryingTest('test_nothing')
     multiply_tests_by_their_scenarios(
         test_instance,
         suite)
     self.assertEquals(
         ['a', 'a', 'b', 'b'],
         get_generated_test_attributes(suite, 'value'))
Esempio n. 4
0
 def test_multiply_tests(self):
     loader = TestLoader()
     suite = loader.suiteClass()
     multiply_tests(
         self,
         vary_by_color(),
         suite)
     self.assertEquals(
         ['blue', 'green', 'red'],
         get_generated_test_attributes(suite, 'color'))
Esempio n. 5
0
def test_suite():
    module_names = [__name__ + '.' + x for x in [
        'test_commands',
        'test_exporter',
        'test_branch_mapper',
        'test_generic_processor',
        'test_revision_store',
        ]]
    loader = TestLoader()
    return loader.loadTestsFromModuleNames(module_names)
Esempio n. 6
0
def test_suite():
    # Thunk across to load_tests for niceness with older bzr versions
    from bzrlib.tests import TestLoader
    loader = TestLoader()
    return loader.loadTestsFromModuleNames(['bzrlib.plugins.search'])
Esempio n. 7
0
def test_suite():
    # Thunk across to load_tests for niceness with older bzr versions
    from bzrlib.tests import TestLoader
    loader = TestLoader()
    return loader.loadTestsFromModuleNames(['bzrlib.plugins.search'])
 def test_multiply_tests_no_scenarios(self):
     """Tests with no scenarios attribute aren't multiplied"""
     suite = TestLoader().suiteClass()
     multiply_tests_by_their_scenarios(self, suite)
     self.assertLength(1, list(iter_suite_tests(suite)))
 def test_multiply_tests(self):
     loader = TestLoader()
     suite = loader.suiteClass()
     multiply_tests(self, vary_by_color(), suite)
     self.assertEqual(['blue', 'green', 'red'],
                      get_generated_test_attributes(suite, 'color'))
Esempio n. 10
0
def test_suite():
    loader = TestLoader()
    return loader.loadTestsFromName(__name__)
Esempio n. 11
0
def test_suite():
    loader = TestLoader()
    return loader.loadTestsFromName(__name__)