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