summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCerberus <matt.dietz@rackspace.com>2010-08-26 13:38:29 -0500
committerCerberus <matt.dietz@rackspace.com>2010-08-26 13:38:29 -0500
commit0d20ee4894f5f8566b00f7a28fabc630ca3195aa (patch)
tree0de6f020bded242382444c8046798009bbd1686c
parent0e09d6fd283673cc9bd5499410cc0b0c7dbea1e9 (diff)
Renamed test.py and moved a test as per merge proposal feedback
-rw-r--r--nova/tests/api/__init__.py59
-rw-r--r--nova/tests/api/rackspace/servers.py3
-rw-r--r--nova/tests/api/test.py59
3 files changed, 62 insertions, 59 deletions
diff --git a/nova/tests/api/__init__.py b/nova/tests/api/__init__.py
index e69de29bb..59c4adc3d 100644
--- a/nova/tests/api/__init__.py
+++ b/nova/tests/api/__init__.py
@@ -0,0 +1,59 @@
+# vim: tabstop=4 shiftwidth=4 softtabstop=4
+
+# Copyright 2010 OpenStack LLC.
+# All Rights Reserved.
+#
+# 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
+#
+# 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.
+
+"""
+Test for the root WSGI middleware for all API controllers.
+"""
+
+import unittest
+
+import stubout
+import webob
+import webob.dec
+
+from nova import api
+from nova.tests.api.test_helper import *
+
+class Test(unittest.TestCase):
+
+ def setUp(self): # pylint: disable-msg=C0103
+ self.stubs = stubout.StubOutForTesting()
+
+ def tearDown(self): # pylint: disable-msg=C0103
+ self.stubs.UnsetAll()
+
+ def test_rackspace(self):
+ self.stubs.Set(api.rackspace, 'API', APIStub)
+ result = webob.Request.blank('/v1.0/cloud').get_response(api.API())
+ self.assertEqual(result.body, "/cloud")
+
+ def test_ec2(self):
+ self.stubs.Set(api.ec2, 'API', APIStub)
+ result = webob.Request.blank('/ec2/cloud').get_response(api.API())
+ self.assertEqual(result.body, "/cloud")
+
+ def test_not_found(self):
+ self.stubs.Set(api.ec2, 'API', APIStub)
+ self.stubs.Set(api.rackspace, 'API', APIStub)
+ result = webob.Request.blank('/test/cloud').get_response(api.API())
+ self.assertNotEqual(result.body, "/cloud")
+
+ def test_query_api_version(self):
+ pass
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/nova/tests/api/rackspace/servers.py b/nova/tests/api/rackspace/servers.py
index 980e69b84..6d628e78a 100644
--- a/nova/tests/api/rackspace/servers.py
+++ b/nova/tests/api/rackspace/servers.py
@@ -36,6 +36,9 @@ class ServersTest(unittest.TestCase):
def test_get_server_by_id(self):
pass
+ def test_get_backup_schedule(self):
+ pass
+
def test_get_server_details(self):
pass
diff --git a/nova/tests/api/test.py b/nova/tests/api/test.py
deleted file mode 100644
index 59c4adc3d..000000000
--- a/nova/tests/api/test.py
+++ /dev/null
@@ -1,59 +0,0 @@
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-
-# Copyright 2010 OpenStack LLC.
-# All Rights Reserved.
-#
-# 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
-#
-# 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.
-
-"""
-Test for the root WSGI middleware for all API controllers.
-"""
-
-import unittest
-
-import stubout
-import webob
-import webob.dec
-
-from nova import api
-from nova.tests.api.test_helper import *
-
-class Test(unittest.TestCase):
-
- def setUp(self): # pylint: disable-msg=C0103
- self.stubs = stubout.StubOutForTesting()
-
- def tearDown(self): # pylint: disable-msg=C0103
- self.stubs.UnsetAll()
-
- def test_rackspace(self):
- self.stubs.Set(api.rackspace, 'API', APIStub)
- result = webob.Request.blank('/v1.0/cloud').get_response(api.API())
- self.assertEqual(result.body, "/cloud")
-
- def test_ec2(self):
- self.stubs.Set(api.ec2, 'API', APIStub)
- result = webob.Request.blank('/ec2/cloud').get_response(api.API())
- self.assertEqual(result.body, "/cloud")
-
- def test_not_found(self):
- self.stubs.Set(api.ec2, 'API', APIStub)
- self.stubs.Set(api.rackspace, 'API', APIStub)
- result = webob.Request.blank('/test/cloud').get_response(api.API())
- self.assertNotEqual(result.body, "/cloud")
-
- def test_query_api_version(self):
- pass
-
-if __name__ == '__main__':
- unittest.main()