@mock.patch('nova.volume.cinder.cinderclient')
    def test_forbidden_cinder_operation_returns_403(self, mock_cinder):
        cinder_client = mock.Mock()
        mock_cinder.return_value = cinder_client
        exc = cinder_exceptions.Forbidden('')
        cinder_client.volumes.create.side_effect = exc

        volume = {'display_name': 'vol1', 'size': 3}
        e = self.assertRaises(client.OpenStackApiException,
                              self.api.post_volume, {'volume': volume})
        self.assertEqual(403, e.response.status_code)
Regression test for bug #1554631.
dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/tests/functional/regressions/test_bug_1554631.py/TestCinderForbidden.test_forbidden_cinder_operation_returns_403