From f0cf610a2ed741520ce261df9175ac05e3edc209 Mon Sep 17 00:00:00 2001 From: Devananda van der Veen Date: Mon, 22 Jul 2013 14:38:51 -0700 Subject: [PATCH] Fix up API tests before updating hacking checks. The new hacking rules will enforce a license header check. This patch updates a few recent files to clean up the header, and remove an extraneous print function that snuck in. Change-Id: Iab5e42d139d4414eb74b0ecc62710f0b23b882e4 --- ironic/tests/api/base.py | 3 ++- ironic/tests/api/test_acl.py | 19 ++++++++++--------- ironic/tests/api/test_nodes.py | 9 ++++----- ironic/tests/api/utils.py | 21 +++++++++++++-------- 4 files changed, 29 insertions(+), 23 deletions(-) diff --git a/ironic/tests/api/base.py b/ironic/tests/api/base.py index 8a9656f21b..a73a717b9b 100644 --- a/ironic/tests/api/base.py +++ b/ironic/tests/api/base.py @@ -1,5 +1,6 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 - +# -*- encoding: utf-8 -*- +# # Copyright 2013 Hewlett-Packard Development Company, L.P. # All Rights Reserved. # diff --git a/ironic/tests/api/test_acl.py b/ironic/tests/api/test_acl.py index 5d9d58c812..5501d60c05 100644 --- a/ironic/tests/api/test_acl.py +++ b/ironic/tests/api/test_acl.py @@ -1,16 +1,17 @@ +# vim: tabstop=4 shiftwidth=4 softtabstop=4 # -*- encoding: utf-8 -*- # -# 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 -# a copy of the License at +# 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 +# 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 -# distributed under the License is distributed on an 'AS IS' BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. """ Tests for ACL. Checks whether certain kinds of requests are blocked or allowed to be processed. diff --git a/ironic/tests/api/test_nodes.py b/ironic/tests/api/test_nodes.py index c1ec0645bb..2a78c2f322 100644 --- a/ironic/tests/api/test_nodes.py +++ b/ironic/tests/api/test_nodes.py @@ -1,7 +1,5 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 - -# Copyright 2013 Hewlett-Packard Development Company, L.P. -# All Rights Reserved. +# -*- encoding: utf-8 -*- # # 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 @@ -14,6 +12,9 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. +""" +Tests for the API /nodes/ methods. +""" import mox @@ -104,8 +105,6 @@ class TestPatch(base.FunctionalTest): response = self.patch_json('/nodes/%s' % self.node['uuid'], {'instance_uuid': 'fake instance uuid'}, expect_errors=True) - print "======================" - print response self.assertEqual(response.content_type, 'application/json') # TODO(deva): change to 409 when wsme 0.5b3 released self.assertEqual(response.status_code, 400) diff --git a/ironic/tests/api/utils.py b/ironic/tests/api/utils.py index 9d7017ab3c..8a45566aab 100644 --- a/ironic/tests/api/utils.py +++ b/ironic/tests/api/utils.py @@ -1,15 +1,20 @@ +# vim: tabstop=4 shiftwidth=4 softtabstop=4 # -*- encoding: utf-8 -*- # -# 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 -# a copy of the License at +# 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 +# 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 -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +""" +Utils for testing the API service. +""" import datetime import json