예제 #1
0
    def test_isTestCaseDisabled(self):
        "TestCases disabled by nose generators don't get loaded"
        class HasDisabled(unittest.TestCase):
            def test_method(self):
                pass

            test_method.__test__ = False

        suite = loader.loadFromTestCase(HasDisabled)
        self.assertEqual(suite.countTestCases(), 0)
예제 #2
0
 def test_normal(self):
     "Normal test methods get loaded"
     class Normal(unittest.TestCase):
         def test_method1(self):
             pass
         def test_method2(self):
             pass
     suite = loader.loadFromTestCase(Normal)
     self.assertEqual(suite.countTestCases(), 2)
     self.assertEqual(set([x._testMethodName for x in suite._tests]),
                      set(['test_method1', 'test_method2']))
예제 #3
0
    def test_isTestCaseDisabled(self):
        """
        TestCases disabled by nose generators don't get loaded
        """
        class HasDisabled(unittest.TestCase):
            def test_method(self):
                pass

            test_method.__test__ = False

        suite = loader.loadFromTestCase(HasDisabled)
        self.assertEqual(suite.countTestCases(), 0)
예제 #4
0
 def test_normal(self):
     """
     Normal test methods get loaded
     """
     class Normal(unittest.TestCase):
         def test_method1(self):
             pass
         def test_method2(self):
             pass
     suite = loader.loadFromTestCase(Normal)
     self.assertEqual(suite.countTestCases(), 2)
     self.assertEqual(set([x._testMethodName for x in suite._tests]),
                      set(['test_method1', 'test_method2']))
예제 #5
0
 def test_runTest(self):
     """
     When a testcase has no matching method names, but does have a runTest,
     use that instead.
     """
     class MyTestCase(unittest.TestCase):
         def helper1(self):
             pass
         def helper2(self):
             pass
         def runTest(self):
             pass
     suite = loader.loadFromTestCase(MyTestCase)
     self.assertEqual(suite.countTestCases(), 1)
     self.assertEqual(suite._tests[0]._testMethodName, 'runTest')
예제 #6
0
 def test_runTest(self):
     """
     When a testcase has no matching method names, but does have a runTest,
     use that instead.
     """
     class MyTestCase(unittest.TestCase):
         def helper1(self):
             pass
         def helper2(self):
             pass
         def runTest(self):
             pass
     suite = loader.loadFromTestCase(MyTestCase)
     self.assertEqual(suite.countTestCases(), 1)
     self.assertEqual(suite._tests[0]._testMethodName, 'runTest')
예제 #7
0
def suite():
    """ return our TestSuite """
    suite = GreenTestSuite()
    suite = loadFromTestCase(TestConfig)
    return suite
예제 #8
0
def suite():
    """ return our TestSuite """
    suite = GreenTestSuite()
    suite = loadFromTestCase(TestConfig)
    return suite