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