Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(8)  |  Call(6)  |  Derive(0)  |  Import(2)

src/e/p/epc-0.0.5/epc/tests/test_server.py   epc(Download)
    ReturnError, EPCError, ReturnErrorCallerUnknown, EPCErrorCallerUnknown, \
    CallerUnknown
from ..py3compat import utf8, Queue, nested
from .utils import mockedattr, logging_to_stdout, CaptureStdIO, BaseTestCase, \
    streamio
    def check_caller_unkown(self, message, eclass, eargs):
        self.check_echo()  # to establish connection to client
        called_with = Queue.Queue()
        with nested(mockedattr(self.server.clients[0],
                               'handle_error', called_with.put),
        # Here comes the actual test:
        uid = 1
        with nested(logging_to_stdout(self.server.logger),
                    mockedattr(handler, 'handle_error', handle_error)):
            self.client_send(make_call(uid))
    def test_log_traceback(self):
        stdio = CaptureStdIO()
        with nested(stdio, mockedattr(self.server, 'log_traceback', True)):
            self.test_error_in_method()
        log = stdio.read_stdout()

src/p/y/python-epc-HEAD/epc/tests/test_server.py   python-epc(Download)
    ReturnError, EPCError, ReturnErrorCallerUnknown, EPCErrorCallerUnknown, \
    CallerUnknown
from ..py3compat import utf8, Queue, nested
from .utils import mockedattr, logging_to_stdout, CaptureStdIO, BaseTestCase, \
    streamio
    def check_caller_unkown(self, message, eclass, eargs):
        self.check_echo()  # to establish connection to client
        called_with = Queue.Queue()
        with nested(mockedattr(self.server.clients[0],
                               'handle_error', called_with.put),
        # Here comes the actual test:
        uid = 1
        with nested(logging_to_stdout(self.server.logger),
                    mockedattr(handler, 'handle_error', handle_error)):
            self.client_send(make_call(uid))
    def test_log_traceback(self):
        stdio = CaptureStdIO()
        with nested(stdio, mockedattr(self.server, 'log_traceback', True)):
            self.test_error_in_method()
        log = stdio.read_stdout()