"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "keystone/tests/unit/test_v3_policy.py" between
keystone-16.0.1.tar.gz and keystone-17.0.0.tar.gz

About: OpenStack Keystone (Core Service: Identity) provides an authentication and authorization service for other OpenStack services. Provides a catalog of endpoints for all OpenStack services.
The "Ussuri" series (latest release).

test_v3_policy.py  (keystone-16.0.1):test_v3_policy.py  (keystone-17.0.0)
skipping to change at line 18 skipping to change at line 18
# #
# Unless required by applicable law or agreed to in writing, software # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import json import json
import uuid import uuid
from six.moves import http_client import http.client
from keystone.common import provider_api from keystone.common import provider_api
from keystone.tests import unit from keystone.tests import unit
from keystone.tests.unit import test_v3 from keystone.tests.unit import test_v3
PROVIDERS = provider_api.ProviderAPIs PROVIDERS = provider_api.ProviderAPIs
class PolicyTestCase(test_v3.RestfulTestCase): class PolicyTestCase(test_v3.RestfulTestCase):
"""Test policy CRUD.""" """Test policy CRUD."""
skipping to change at line 50 skipping to change at line 50
"""Call ``POST /policies``.""" """Call ``POST /policies``."""
ref = unit.new_policy_ref() ref = unit.new_policy_ref()
r = self.post('/policies', body={'policy': ref}) r = self.post('/policies', body={'policy': ref})
return self.assertValidPolicyResponse(r, ref) return self.assertValidPolicyResponse(r, ref)
def test_list_head_policies(self): def test_list_head_policies(self):
"""Call ``GET & HEAD /policies``.""" """Call ``GET & HEAD /policies``."""
resource_url = '/policies' resource_url = '/policies'
r = self.get(resource_url) r = self.get(resource_url)
self.assertValidPolicyListResponse(r, ref=self.policy) self.assertValidPolicyListResponse(r, ref=self.policy)
self.head(resource_url, expected_status=http_client.OK) self.head(resource_url, expected_status=http.client.OK)
def test_get_head_policy(self): def test_get_head_policy(self):
"""Call ``GET & HEAD /policies/{policy_id}``.""" """Call ``GET & HEAD /policies/{policy_id}``."""
resource_url = ('/policies/%(policy_id)s' % resource_url = ('/policies/%(policy_id)s' %
{'policy_id': self.policy_id}) {'policy_id': self.policy_id})
r = self.get(resource_url) r = self.get(resource_url)
self.assertValidPolicyResponse(r, self.policy) self.assertValidPolicyResponse(r, self.policy)
self.head(resource_url, expected_status=http_client.OK) self.head(resource_url, expected_status=http.client.OK)
def test_update_policy(self): def test_update_policy(self):
"""Call ``PATCH /policies/{policy_id}``.""" """Call ``PATCH /policies/{policy_id}``."""
self.policy['blob'] = json.dumps({'data': uuid.uuid4().hex, }) self.policy['blob'] = json.dumps({'data': uuid.uuid4().hex, })
r = self.patch( r = self.patch(
'/policies/%(policy_id)s' % {'policy_id': self.policy_id}, '/policies/%(policy_id)s' % {'policy_id': self.policy_id},
body={'policy': self.policy}) body={'policy': self.policy})
self.assertValidPolicyResponse(r, self.policy) self.assertValidPolicyResponse(r, self.policy)
def test_delete_policy(self): def test_delete_policy(self):
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)