예제 #1
0
 def test_server_socket_shutdown(self):
     server = Server(self.site)
     server.start(wait=True)
     server.shutdown(wait=True)
     server = Server(self.site)
     server.start(wait=True)
     server.shutdown(wait=True)
예제 #2
0
 def test_index(self):
     self.site.build()
     server = Server(self.site)
     server.start(wait=True)
     try:
         request = urlopen('http://localhost:8000/testdir/')
         assert request.read().strip() == 'testdir/index.html'
     finally:
         server.shutdown(wait=True)
예제 #3
0
 def test_non_index(self):
     self.site.build()
     server = Server(self.site)
     server.start(wait=True)
     try:
         request = urlopen('http://localhost:8000/')
         request.read()
     except HTTPError:
         pass
     else:
         assert False, "This request should be 404"
     finally:
         server.shutdown(wait=True)
예제 #4
0
 def test_server_launch(self):
     server = Server(self.site)
     server.start(wait=True)
     server.shutdown(wait=True)