コード例 #1
0
 def setUp(self):
     if is_monkey_patched():
         raise unittest.SkipTest("Can't test libev with monkey patching")
     if LibevConnection is None:
         raise unittest.SkipTest(
             'libev does not appear to be installed correctly')
     LibevConnection.initialize_reactor()
コード例 #2
0
 def setUp(self):
     if 'gevent.monkey' in sys.modules:
         raise unittest.SkipTest("gevent monkey-patching detected")
     if LibevConnection is None:
         raise unittest.SkipTest(
             'libev does not appear to be installed correctly')
     LibevConnection.initialize_reactor()
コード例 #3
0
    def setUp(self):
        if is_monkey_patched():
            raise unittest.SkipTest("Can't test libev with monkey patching.")
        if LibevConnection is None:
            raise unittest.SkipTest('libev does not appear to be installed correctly')

        LibevConnection.initialize_reactor()
        super(LibevTimerTest, self).setUp()
コード例 #4
0
    def setUp(self):
        if is_monkey_patched():
            raise unittest.SkipTest("Can't test libev with monkey patching")
        if LibevConnection is None:
            raise unittest.SkipTest('libev does not appear to be installed correctly')
        LibevConnection.initialize_reactor()

        # we patch here rather than as a decorator so that the Mixin can avoid
        # specifying patch args to test methods
        patchers = [patch(obj) for obj in
                    ('socket.socket',
                     'cassandra.io.libevwrapper.IO',
                     'cassandra.io.libevreactor.LibevLoop.maybe_start'
                     )]
        for p in patchers:
            self.addCleanup(p.stop)
        for p in patchers:
            p.start()
コード例 #5
0
    def setUp(self):
        if is_monkey_patched():
            raise unittest.SkipTest("Can't test libev with monkey patching")
        if LibevConnection is None:
            raise unittest.SkipTest('libev does not appear to be installed correctly')
        LibevConnection.initialize_reactor()

        # we patch here rather than as a decorator so that the Mixin can avoid
        # specifying patch args to test methods
        patchers = [patch(obj) for obj in
                    ('socket.socket',
                     'cassandra.io.libevwrapper.IO',
                     'cassandra.io.libevreactor.LibevLoop.maybe_start'
                     )]
        for p in patchers:
            self.addCleanup(p.stop)
        for p in patchers:
            p.start()
コード例 #6
0
 def make_connection(self):
     c = LibevConnection('1.2.3.4', cql_version='3.0.1')
     c._socket = Mock()
     c._socket.send.side_effect = lambda x: len(x)
     return c
コード例 #7
0
 def setUp(self):
     if 'gevent.monkey' in sys.modules:
         raise unittest.SkipTest("Can't test libev with monkey patching")
     if LibevConnection is None:
         raise unittest.SkipTest('libev does not appear to be installed correctly')
     LibevConnection.initialize_reactor()
コード例 #8
0
 def make_connection(self):
     c = LibevConnection('1.2.3.4', cql_version='3.0.1')
     c._socket = Mock()
     c._socket.send.side_effect = lambda x: len(x)
     return c
コード例 #9
0
 def setUp(self):
     if LibevConnection is None:
         raise unittest.SkipTest(
             'libev does not appear to be installed correctly')
     LibevConnection.initialize_reactor()
コード例 #10
0
 def setUp(self):
     if LibevConnection is None:
         raise unittest.SkipTest('libev does not appear to be installed correctly')
     LibevConnection.initialize_reactor()
コード例 #11
0
 def make_connection(self):
     c = LibevConnection("1.2.3.4")
     c._socket = Mock()
     c._socket.send.side_effect = lambda x: len(x)
     return c