Exemplo n.º 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"))
Exemplo n.º 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
Exemplo n.º 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"))
Exemplo n.º 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)
Exemplo n.º 5
0
 def test_tcp_server(self):
     factory = ProtocolFactory()
     factory.protocol = Protocol
     server = TcpServer(loop, factory, "0.0.0.0", 2000)
     server = None
Exemplo n.º 6
0
 def test_factory_build(self):
     factory = ProtocolFactory()
     factory.protocol = Protocol
     p = factory.build(loop)
     self.assertTrue(isinstance(p, Protocol))
Exemplo n.º 7
0
 def test_factory(self):
     factory = ProtocolFactory()
Exemplo n.º 8
0
 def test_tcp_server(self):
     factory = ProtocolFactory()
     factory.protocol = Protocol
     server = TcpServer(loop, factory, "0.0.0.0", 2000)
     server = None
Exemplo n.º 9
0
 def __init__(self):
     ProtocolFactory.__init__(self)
     self.builds = 0
Exemplo n.º 10
0
 def __init__(self, dispatch=Dispatch()):
     ProtocolFactory.__init__(self)
     self.dispatch = dispatch
     self.protocol = MsgPackProtocol
     self.protocols = []
Exemplo n.º 11
0
 def test_unix_client(self):
     factory = ProtocolFactory()
     factory.protocol = Protocol
     client = UnixClient(loop, MockFactory(), "bogus")
Exemplo n.º 12
0
 def test_tcp_client(self):
     factory = ProtocolFactory()
     factory.protocol = Protocol
     client = TcpClient(loop, MockFactory(), "0.0.0.0", 2000)
Exemplo n.º 13
0
 def __init__(self, dispatch=Dispatch()):
     ProtocolFactory.__init__(self)
     self.dispatch = dispatch
     self.protocol = PickleProtocol
     self.protocols = []
Exemplo n.º 14
0
 def __init__(self):
     ProtocolFactory.__init__(self)
     self.builds = 0