Ejemplo n.º 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()
Ejemplo n.º 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()
Ejemplo n.º 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()
    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()
Ejemplo n.º 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()
 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
 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()
Ejemplo n.º 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
Ejemplo n.º 9
0
 def setUp(self):
     if LibevConnection is None:
         raise unittest.SkipTest(
             'libev does not appear to be installed correctly')
     LibevConnection.initialize_reactor()
Ejemplo n.º 10
0
 def setUp(self):
     if LibevConnection is None:
         raise unittest.SkipTest('libev does not appear to be installed correctly')
     LibevConnection.initialize_reactor()
Ejemplo n.º 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