Ejemplo n.º 1
0
class reporter_proxy_isSuccessful(TestCase):
    def setUp(self):
        from testoob.reporting.reporter_proxy import ReporterProxy
        self.proxy = ReporterProxy()

        from testoob.reporting.base import BaseReporter

        class SuccessReporter(BaseReporter):
            def __init__(self):
                BaseReporter.__init__(self)
                self.success = True

            def isSuccessful(self):
                return self.success

        self.reporters = (SuccessReporter(), SuccessReporter())
        for reporter in self.reporters:
            self.proxy.add_observer(reporter)

    def tearDown(self):
        del self.reporters
        del self.proxy

    def test_all_success(self):
        self.failUnless(self.proxy.isSuccessful())

    def test_one_failure(self):
        self.reporters[0].success = False
        self.failIf(self.proxy.isSuccessful())

    def test_all_failures(self):
        for reporter in self.reporters:
            reporter.success = False
        self.failIf(self.proxy.isSuccessful())
Ejemplo n.º 2
0
class reporter_proxy_isSuccessful(TestCase):
    def setUp(self):
        from testoob.reporting.reporter_proxy import ReporterProxy
        self.proxy = ReporterProxy()

        from testoob.reporting.base import BaseReporter
        class SuccessReporter(BaseReporter):
            def __init__(self):
                BaseReporter.__init__(self)
                self.success = True
            def isSuccessful(self):
                return self.success

        self.reporters = (SuccessReporter(), SuccessReporter())
        for reporter in self.reporters:
            self.proxy.add_observer(reporter)

    def tearDown(self):
        del self.reporters
        del self.proxy

    def test_all_success(self):
        self.failUnless( self.proxy.isSuccessful() )

    def test_one_failure(self):
        self.reporters[0].success = False
        self.failIf( self.proxy.isSuccessful() )

    def test_all_failures(self):
        for reporter in self.reporters:
            reporter.success = False
        self.failIf( self.proxy.isSuccessful() )
Ejemplo n.º 3
0
    def _run_fixtures(self):
        queue = self._get_pyro_proxy("queue")
        remote_reporter = self._get_pyro_proxy("reporter")

        from testoob.reporting.reporter_proxy import ReporterProxy

        local_reporter = ReporterProxy()
        local_reporter.add_observer(remote_reporter)

        for id in iter_queue(queue, None, timeout=PyroRunner.GET_TIMEOUT):
            fixture = self.fixture_ids[id]
            fixture(local_reporter)
Ejemplo n.º 4
0
    def _run_fixtures(self):
        queue = self._get_pyro_proxy("queue")
        remote_reporter = self._get_pyro_proxy("reporter")

        from testoob.reporting.reporter_proxy import ReporterProxy

        local_reporter = ReporterProxy()
        local_reporter.add_observer(remote_reporter)

        for id in iter_queue(queue, None, timeout=PyroRunner.GET_TIMEOUT):
            fixture = self.fixture_ids[id]
            fixture(local_reporter)
Ejemplo n.º 5
0
    def setUp(self):
        from testoob.reporting.reporter_proxy import ReporterProxy
        self.proxy = ReporterProxy()

        from testoob.reporting.base import BaseReporter

        class SuccessReporter(BaseReporter):
            def __init__(self):
                BaseReporter.__init__(self)
                self.success = True

            def isSuccessful(self):
                return self.success

        self.reporters = (SuccessReporter(), SuccessReporter())
        for reporter in self.reporters:
            self.proxy.add_observer(reporter)
Ejemplo n.º 6
0
class reporter_proxy_proxies(TestCase):
    def setUp(self):
        from testoob.reporting.reporter_proxy import ReporterProxy
        self.proxy = ReporterProxy()
        self.reporter = MethodsCalledMock()
        self.proxy.add_observer(self.reporter)

    def tearDown(self):
        del self.proxy
        del self.reporter

    def _check_method_proxy(self, method_name, *args):
        method = getattr(self.proxy, method_name)
        method(*args)
        self.assertEqual(method_name, self.reporter.last_method)

    def test_start(self):
        self._check_method_proxy("start")

    def test_done(self):
        self._check_method_proxy("done")

    def test_startTest(self):
        self._check_method_proxy("startTest", None)

    def test_stopTest(self):
        self._check_method_proxy("stopTest", None)

    def test_addError(self):
        self._check_method_proxy("addError", None, (Exception, None, None))

    def test_addFailure(self):
        self._check_method_proxy("addFailure", None, None)

    def test_addSuccess(self):
        self._check_method_proxy("addSuccess", None)

    def test_addAssert(self):
        self._check_method_proxy("addAssert", None, None, None, None)

    def test_addSkip(self):
        self._check_method_proxy("addSkip", None, None)

    def test_isSuccessful(self):
        self._check_method_proxy("isSuccessful")
Ejemplo n.º 7
0
    def setUp(self):
        from testoob.reporting.reporter_proxy import ReporterProxy
        self.proxy = ReporterProxy()

        from testoob.reporting.base import BaseReporter
        class SuccessReporter(BaseReporter):
            def __init__(self):
                BaseReporter.__init__(self)
                self.success = True
            def isSuccessful(self):
                return self.success

        self.reporters = (SuccessReporter(), SuccessReporter())
        for reporter in self.reporters:
            self.proxy.add_observer(reporter)
Ejemplo n.º 8
0
class reporter_proxy_proxies(TestCase):
    def setUp(self):
        from testoob.reporting.reporter_proxy import ReporterProxy
        self.proxy = ReporterProxy()
        self.reporter = MethodsCalledMock()
        self.proxy.add_observer(self.reporter)

    def tearDown(self):
        del self.proxy
        del self.reporter

    def _check_method_proxy(self, method_name, *args):
        method = getattr(self.proxy, method_name)
        method(*args)
        self.assertEqual( method_name, self.reporter.last_method )

    def test_start(self):
        self._check_method_proxy("start")
    def test_done(self):
        self._check_method_proxy("done")
    def test_startTest(self):
        self._check_method_proxy("startTest", None)
    def test_stopTest(self):
        self._check_method_proxy("stopTest", None)
    def test_addError(self):
        self._check_method_proxy("addError", None, (Exception, None, None))
    def test_addFailure(self):
        self._check_method_proxy("addFailure", None, None)
    def test_addSuccess(self):
        self._check_method_proxy("addSuccess", None)
    def test_addAssert(self):
        self._check_method_proxy("addAssert", None, None, None, None)
    def test_addSkip(self):
        self._check_method_proxy("addSkip", None, None)
    def test_isSuccessful(self):
        self._check_method_proxy("isSuccessful")
Ejemplo n.º 9
0
 def setUp(self):
     from testoob.reporting.reporter_proxy import ReporterProxy
     self.proxy = ReporterProxy()
     self.reporter = MethodsCalledMock()
     self.proxy.add_observer(self.reporter)
Ejemplo n.º 10
0
 def setUp(self):
     from testoob.reporting.reporter_proxy import ReporterProxy
     self.proxy = ReporterProxy()
     self.reporter = MethodsCalledMock()
     self.proxy.add_observer(self.reporter)