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

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

src/d/h/DHTBot-HEAD/dhtbot/coding/krpc_coder.py   DHTBot(Download)
from dhtbot.coding import basic_coder
from dhtbot.coding.bencode import bdecode, bencode, BTFailure
from dhtbot.krpc_types import Query, Response, Error
 
class InvalidKRPCError(Exception):
 
    """
    e = Error()
    e.code, e.message = rpc_dict['e']
    if e.code not in [201, 202, 203]:

src/d/h/DHTBot-HEAD/dhtbot/protocols/krpc_sender.py   DHTBot(Download)
from dhtbot.coding import krpc_coder
from dhtbot.coding.krpc_coder import InvalidKRPCError
from dhtbot.krpc_types import Query, Response, Error
from dhtbot.transaction import Transaction
from dhtbot.protocols.errors import TimeoutError, KRPCError 

src/d/h/DHTBot-HEAD/dhtbot/test/test_krpc_types.py   DHTBot(Download)
from twisted.trial import unittest
 
from dhtbot.krpc_types import _KRPC, Query, Response, Error
 
class KRPCTestCase(unittest.TestCase):
    def test_repr(self):
        e = Error()
        e._transaction_id = 222
        e.code = 202
        e.message = "Invalid Query"

src/d/h/DHTBot-HEAD/dhtbot/test/protocols/test_krpc_sender.py   DHTBot(Download)
from twisted.trial import unittest
from twisted.python.monkey import MonkeyPatcher
 
from dhtbot.krpc_types import Query, Response, Error
from dhtbot.kademlia.routing_table import TreeRoutingTable

src/d/h/DHTBot-HEAD/dhtbot/test/coding/test_krpc_coder.py   DHTBot(Download)
        InvalidKRPCError)
from dhtbot.coding import basic_coder
from dhtbot.krpc_types import Query, Response, Error
from dhtbot.contact import Node
 
    def test_encode_and_decode_validError(self):
        e = Error()
        e._transaction_id = 129085
        e.code = 202
        e.message = ""
    def test_encode_invalidErrorCode(self):
        e = Error()
        e._transaction_id = 9052
        # e.code must be in {201, 202, 203}
        e.code = 512