

def test_reserve_background_thread_success(self):
    inst = instance.Instance(self.request_data, 'name', self.proxy, max_concurrent_requests=5, max_background_threads=2)
    inst._started = True
    self.mox.ReplayAll()
    self.assertEqual(2, inst.remaining_background_thread_capacity)
    inst.reserve_background_thread()
    self.assertEqual(1, inst.remaining_background_thread_capacity)
    self.mox.VerifyAll()

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