예제 #1
0
class MockTransport(Transport):

    def __init__(self, datalink=None):
        self.datalink = MockDataLink()

    def sendPacket(self, *args, **kwargs):
        logger.debug("Transport <= %s %s" % (args, kwargs))
        self.datalink.write(*args, **kwargs)

    def readPacket(self, *args, **kwargs):
        logger.debug("Transport => %s %s" % (args, kwargs))
        return self.datalink.read(*args, **kwargs)

    def sendRequest(self, *args, **kwargs):
        return 1
예제 #2
0
 def __init__(self, datalink=None):
     self.datalink = MockDataLink()