Esempio n. 1
0
 def test_run(self):
     edge = EdgeServer(('127.0.0.1', 0), None)
     self.mox.StubOutWithMock(edge.server, 'start')
     self.mox.StubOutWithMock(edge.server, 'serve_forever')
     edge.server.start()
     edge.server.serve_forever()
     self.mox.ReplayAll()
     edge._run()
Esempio n. 2
0
 def test_run(self):
     edge = EdgeServer(('127.0.0.1', 0), None)
     self.mox.StubOutWithMock(edge.server, 'start')
     self.mox.StubOutWithMock(edge.server, 'serve_forever')
     edge.server.start()
     edge.server.serve_forever()
     self.mox.ReplayAll()
     edge._run()
Esempio n. 3
0
 def test_handle(self):
     queue = self.mox.CreateMockAnything()
     sock = self.mox.CreateMockAnything()
     edge = EdgeServer(('127.0.0.1', 0), queue)
     self.mox.StubOutWithMock(edge, 'handle')
     sock.fileno().AndReturn(15)
     edge.handle(sock, 'test address')
     self.mox.ReplayAll()
     try:
         edge.server.pre_start()
     except AttributeError:
         edge.server.init_socket()
     edge._handle(sock, 'test address')
Esempio n. 4
0
 def test_handle(self):
     queue = self.mox.CreateMockAnything()
     sock = self.mox.CreateMockAnything()
     edge = EdgeServer(('127.0.0.1', 0), queue)
     self.mox.StubOutWithMock(edge, 'handle')
     sock.fileno().AndReturn(15)
     edge.handle(sock, 'test address')
     self.mox.ReplayAll()
     try:
         edge.server.pre_start()
     except AttributeError:
         edge.server.init_socket()
     edge._handle(sock, 'test address')
Esempio n. 5
0
 def test_kill(self):
     edge = EdgeServer(('127.0.0.1', 0), None)
     self.mox.StubOutWithMock(edge.server, 'stop')
     edge.server.stop()
     self.mox.ReplayAll()
     edge.kill()
Esempio n. 6
0
 def test_edge_interface(self):
     edge = EdgeServer(('127.0.0.1', 0), None)
     with self.assertRaises(NotImplementedError):
         edge.handle(None, None)
Esempio n. 7
0
 def test_kill(self):
     edge = EdgeServer(('127.0.0.1', 0), None)
     self.mox.StubOutWithMock(edge.server, 'stop')
     edge.server.stop()
     self.mox.ReplayAll()
     edge.kill()
Esempio n. 8
0
 def test_edge_interface(self):
     edge = EdgeServer(('127.0.0.1', 0), None)
     with self.assertRaises(NotImplementedError):
         edge.handle(None, None)