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

All Samples(9)  |  Call(5)  |  Derive(0)  |  Import(4)

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
        counter = Counter()
        k_messenger = KRPC_Sender(TreeRoutingTable, 2**50)
        k_messenger.transport = HollowTransport()
        k_messenger.responseReceived = counter
        # Send the query and receive the response
    def setUp(self):
        _swap_out_reactor()
        self.k_messenger = KRPC_Sender(TreeRoutingTable, 2**50)
        self.k_messenger.transport = HollowTransport()
        self.query = Query()

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 _patched_responder(self, node_id=None):
        kresponder = KRPC_Responder(node_id=node_id)
        kresponder.transport = HollowTransport()
        kresponder.sendResponse = SendResponseWrapper(kresponder.sendResponse)
        return kresponder

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))
        self.monkey_patcher.patch()
        self.k_iter = KRPC_Iterator()
        self.k_iter.transport = HollowTransport()
        self.target_id = 5
 

src/d/h/DHTBot-HEAD/dhtbot/test/extensions/test_rate_limiter.py   DHTBot(Download)
from dhtbot.krpc_types import Query
from dhtbot.protocols.krpc_sender import KRPC_Sender
from dhtbot.test.utils import Clock, Counter, HollowTransport
 
class TestingBase(object):
    def _patched_sender(self):
        ksender = KRPC_Sender(TreeRoutingTable, 2**50)
        ksender.transport = HollowTransport()
        # Start the protocol to simulate
        # a regular environment