

def test_handle_while_quitting(self):
    inst = instance.Instance(self.request_data, 'name', self.proxy, max_concurrent_requests=5)
    self.mox.StubOutWithMock(inst._condition, 'notify')
    inst._num_outstanding_requests = 1
    self.proxy.start()
    self.mox.ReplayAll()
    inst.start()
    inst.quit(allow_async=True)
    self.mox.VerifyAll()
    self.assertRaises(instance.CannotAcceptRequests, inst.handle, self.environ, self.start_response, self.url_map, self.match, self.request_id, instance.NORMAL_REQUEST)

dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/tools/devappserver2/instance_test.py TestInstance.test_handle_while_quitting/original