Merge "Fix up API tests before updating hacking checks."

This commit is contained in:
Jenkins
2013-07-22 21:53:05 +00:00
committed by Gerrit Code Review
4 changed files with 29 additions and 23 deletions

View File

@@ -1,5 +1,6 @@
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # vim: tabstop=4 shiftwidth=4 softtabstop=4
# -*- encoding: utf-8 -*-
#
# Copyright 2013 Hewlett-Packard Development Company, L.P. # Copyright 2013 Hewlett-Packard Development Company, L.P.
# All Rights Reserved. # All Rights Reserved.
# #

View File

@@ -1,16 +1,17 @@
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# -*- encoding: utf-8 -*- # -*- encoding: utf-8 -*-
# #
# Licensed under the Apache License, Version 2.0 (the 'License'); you may # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain # not use this file except in compliance with the License. You may obtain
# a copy of the License at # a copy of the License at
# #
# http://www.apache.org/licenses/LICENSE-2.0 # http://www.apache.org/licenses/LICENSE-2.0
# #
# 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.
""" """
Tests for ACL. Checks whether certain kinds of requests Tests for ACL. Checks whether certain kinds of requests
are blocked or allowed to be processed. are blocked or allowed to be processed.

View File

@@ -1,7 +1,5 @@
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # vim: tabstop=4 shiftwidth=4 softtabstop=4
# -*- encoding: utf-8 -*-
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# All Rights Reserved.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain # not use this file except in compliance with the License. You may obtain
@@ -14,6 +12,9 @@
# 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.
"""
Tests for the API /nodes/ methods.
"""
import mox import mox
@@ -104,8 +105,6 @@ class TestPatch(base.FunctionalTest):
response = self.patch_json('/nodes/%s' % self.node['uuid'], response = self.patch_json('/nodes/%s' % self.node['uuid'],
{'instance_uuid': 'fake instance uuid'}, {'instance_uuid': 'fake instance uuid'},
expect_errors=True) expect_errors=True)
print "======================"
print response
self.assertEqual(response.content_type, 'application/json') self.assertEqual(response.content_type, 'application/json')
# TODO(deva): change to 409 when wsme 0.5b3 released # TODO(deva): change to 409 when wsme 0.5b3 released
self.assertEqual(response.status_code, 400) self.assertEqual(response.status_code, 400)

View File

@@ -1,15 +1,20 @@
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# -*- encoding: utf-8 -*- # -*- encoding: utf-8 -*-
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain # not use this file except in compliance with the License. You may obtain
# a copy of the License at # a copy of the License at
# #
# http://www.apache.org/licenses/LICENSE-2.0 # http://www.apache.org/licenses/LICENSE-2.0
# #
# 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.
"""
Utils for testing the API service.
"""
import datetime import datetime
import json import json