Beispiel #1
0
 def test_unix_server(self):
     factory = ProtocolFactory()
     factory.protocol = Protocol
     server = UnixServer(loop, factory, "bogus")
     server = None
     # path should be cleaned up as soon as garbage collected
     gc.collect()
     self.assertTrue(not os.path.exists("bogus"))
Beispiel #2
0
 def __init__(self, loop, path, files_cb):
     factory = ProtocolFactory()
     factory.protocol = WatchmanProtocol
     UnixClient.__init__(self, loop, factory, path)
     self.factory = factory
     self.path = path
     self.loop = loop
     self.files_cb = files_cb
Beispiel #3
0
 def test_unix_server(self):
     factory = ProtocolFactory()
     factory.protocol = Protocol
     server = UnixServer(loop, factory, "bogus")
     server = None
     # path should be cleaned up as soon as garbage collected
     gc.collect()
     self.assertTrue(not os.path.exists("bogus"))
Beispiel #4
0
 def test_lose_connection(self):
     factory = ProtocolFactory()
     factory.protocol = Protocol
     p = factory.build(loop)
     self.assertTrue(isinstance(p, Protocol))
     t = MockTransport()
     p.make_connection(t, 'test')
     p.lose_connection()
     self.assertTrue(t.closes==1)
Beispiel #5
0
 def test_tcp_server(self):
     factory = ProtocolFactory()
     factory.protocol = Protocol
     server = TcpServer(loop, factory, "0.0.0.0", 2000)
     server = None
Beispiel #6
0
 def test_factory_build(self):
     factory = ProtocolFactory()
     factory.protocol = Protocol
     p = factory.build(loop)
     self.assertTrue(isinstance(p, Protocol))
Beispiel #7
0
 def test_factory(self):
     factory = ProtocolFactory()
Beispiel #8
0
 def test_tcp_server(self):
     factory = ProtocolFactory()
     factory.protocol = Protocol
     server = TcpServer(loop, factory, "0.0.0.0", 2000)
     server = None
Beispiel #9
0
 def __init__(self):
     ProtocolFactory.__init__(self)
     self.builds = 0
Beispiel #10
0
 def __init__(self, dispatch=Dispatch()):
     ProtocolFactory.__init__(self)
     self.dispatch = dispatch
     self.protocol = MsgPackProtocol
     self.protocols = []
Beispiel #11
0
 def test_unix_client(self):
     factory = ProtocolFactory()
     factory.protocol = Protocol
     client = UnixClient(loop, MockFactory(), "bogus")
Beispiel #12
0
 def test_tcp_client(self):
     factory = ProtocolFactory()
     factory.protocol = Protocol
     client = TcpClient(loop, MockFactory(), "0.0.0.0", 2000)
Beispiel #13
0
 def __init__(self, dispatch=Dispatch()):
     ProtocolFactory.__init__(self)
     self.dispatch = dispatch
     self.protocol = PickleProtocol
     self.protocols = []
Beispiel #14
0
 def __init__(self):
     ProtocolFactory.__init__(self)
     self.builds = 0