Ejemplo n.º 1
0
        self.org_stdout = sys.stdout
        sys.stdout = StringIO()
        target.check_print_result = self.check_print_result

    def tearDown(self):
        try:
            assert_equal("", sys.stdout.getvalue())
        finally:
            sys.stdout = self.org_stdout

    def check_print_result(self, expectedString):
        assert_equal(expectedString, sys.stdout.getvalue())
        sys.stdout = StringIO()


_PLUGINLIST = [printPlugin(), stubMockPlugin.stubPlugin(), stubMockPlugin.mockPlugin()]


class myTestCase(unittest.TestCase):
    def setUp(self):
        for plugin in _PLUGINLIST:
            plugin.setUp(self)

        self.my_setup()

    def tearDown(self):
        for plugin in _PLUGINLIST:
            plugin.tearDown()

        self.my_teardown()
Ejemplo n.º 2
0
 def setUp(self):
     self.stub = stubPlugin()