'Test flavor manage edge conditions.
- Bogus body is a 400
- Unknown flavor is a 404
- Deleting unknown flavor is a 404'

def test_flavor_manage_func_negative(self):

    resp = self.api.api_post('flavors', '', check_response_status=False)
    self.assertEqual(400, resp.status)
    resp = self.api.api_delete('flavors/foo', check_response_status=False)
    self.assertEqual(404, resp.status)
    resp = self.api.api_delete('flavors/foo', check_response_status=False)
    self.assertEqual(404, resp.status)
    ctx = context.get_admin_context()
    flav = {'flavor': rand_flavor(vcpus=0)}
    resp = self.api.api_post('flavors', flav, check_response_status=False)
    self.assertEqual(400, resp.status, resp)
    self.assertRaises(ex.FlavorNotFound, objects.Flavor.get_by_flavor_id, ctx, flav['flavor']['id'])
    flav = {'flavor': rand_flavor(ram=0)}
    resp = self.api.api_post('flavors', flav, check_response_status=False)
    self.assertEqual(400, resp.status)
    self.assertRaises(ex.FlavorNotFound, objects.Flavor.get_by_flavor_id, ctx, flav['flavor']['id'])
