← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1179350] Re: Invalid status code assertion after handle expected exception

 

** Changed in: quantum
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to quantum.
https://bugs.launchpad.net/bugs/1179350

Title:
  Invalid status code assertion after handle expected exception

Status in OpenStack Quantum (virtual network service):
  Fix Released

Bug description:
  def test_create_two_subnets_same_cidr_returns_400(self):
          gateway_ip_1 = '10.0.0.1'
          cidr_1 = '10.0.0.0/24'
          gateway_ip_2 = '10.0.0.10'
          cidr_2 = '10.0.0.0/24'
          with self.network() as network:
              with self.subnet(network=network,
                               gateway_ip=gateway_ip_1,
                               cidr=cidr_1):
                  with testtools.ExpectedException(
                          webob.exc.HTTPClientError) as ctx_manager:
                      with self.subnet(network=network,
                                       gateway_ip=gateway_ip_2,
                                       cidr=cidr_2):
                          pass
                      <! ----------------  Because self.subnet raise the exception, then will exit the with block, so code never can reach at here' ---------------->
                      self.assertEqual(ctx_manager.exception.code, 400)

  There are many test-case like this using 'testtools.ExpectedException'
  and with invalid status code assertion.

To manage notifications about this bug go to:
https://bugs.launchpad.net/quantum/+bug/1179350/+subscriptions