Exemplo n.º 1
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.assertEqual(['a', 'a', 'b', 'b'],
                      get_generated_test_attributes(suite, 'value'))
Exemplo 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
Exemplo 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'))
Exemplo 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'))
Exemplo 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)
Exemplo 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'])
Exemplo 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'])
Exemplo n.º 8
0
 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)))
Exemplo n.º 9
0
 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'))
Exemplo n.º 10
0
def test_suite():
    loader = TestLoader()
    return loader.loadTestsFromName(__name__)
Exemplo n.º 11
0
def test_suite():
    loader = TestLoader()
    return loader.loadTestsFromName(__name__)