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

All Samples(6)  |  Call(3)  |  Derive(0)  |  Import(3)

src/d/h/DHTBot-HEAD/dhtbot/test/protocols/test_krpc_sender.py   DHTBot(Download)
from dhtbot.protocols.errors import TimeoutError
from dhtbot.coding import krpc_coder
from dhtbot.test.utils import Clock, HollowReactor, HollowTransport, Counter
 
# Write two functions that simply remove / restore
# the reactor for krpc_sender
monkey_patcher = MonkeyPatcher()
 
def _swap_out_reactor():
    monkey_patcher.addPatch(krpc_sender, "reactor", HollowReactor())

src/d/h/DHTBot-HEAD/dhtbot/test/protocols/test_krpc_responder.py   DHTBot(Download)
from dhtbot.protocols import krpc_responder, krpc_sender
from dhtbot.protocols.krpc_responder import KRPC_Responder, _TokenGenerator
from dhtbot.test.utils import HollowReactor, HollowTransport
 
monkey_patcher = MonkeyPatcher()
    def setUp(self):
        monkey_patcher.addPatch(krpc_sender, "reactor", HollowReactor())
        monkey_patcher.patch()
 
    def tearDown(self):

src/d/h/DHTBot-HEAD/dhtbot/test/protocols/test_krpc_iterator.py   DHTBot(Download)
from dhtbot.protocols.errors import TimeoutError
 
from dhtbot.test.utils import Counter, HollowTransport, HollowReactor
 
make_node = lambda num: Node(num, ("127.0.0.1", num))
    def setUp(self):
        self.monkey_patcher = MonkeyPatcher()
        self.monkey_patcher.addPatch(krpc_sender, "reactor", HollowReactor())
        self.monkey_patcher.patch()
        self.k_iter = KRPC_Iterator()