summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCerberus <matt.dietz@rackspace.com>2010-09-01 17:03:35 +0000
committerTarmac <>2010-09-01 17:03:35 +0000
commit937e8fae0237aed835ab2a55b4d4f0885a04f1d5 (patch)
tree1edd62f50d8c8ba0f465ba2fade6e0963cc735fb
parentd2ff9c07354666e9fad840a4e929960cc3ff3e37 (diff)
parentaba23f942b36263141033f2c5c289d69d08095fc (diff)
Moved API tests into a sub-folder of the tests/ and added a stubbed-out test declarations to mirror existing API tickets.
Resubmission from earlier because of my improper file move.
-rw-r--r--nova/tests/api/__init__.py (renamed from nova/api/test.py)12
-rw-r--r--nova/tests/api/rackspace/__init__.py0
-rw-r--r--nova/tests/api/rackspace/flavors.py34
-rw-r--r--nova/tests/api/rackspace/images.py39
-rw-r--r--nova/tests/api/rackspace/servers.py58
-rw-r--r--nova/tests/api/rackspace/sharedipgroups.py40
-rw-r--r--nova/tests/api/test_helper.py7
-rw-r--r--nova/tests/api/wsgi_test.py (renamed from nova/wsgi_test.py)0
8 files changed, 183 insertions, 7 deletions
diff --git a/nova/api/test.py b/nova/tests/api/__init__.py
index 51b114b8e..59c4adc3d 100644
--- a/nova/api/test.py
+++ b/nova/tests/api/__init__.py
@@ -26,7 +26,7 @@ import webob
import webob.dec
from nova import api
-
+from nova.tests.api.test_helper import *
class Test(unittest.TestCase):
@@ -52,10 +52,8 @@ class Test(unittest.TestCase):
result = webob.Request.blank('/test/cloud').get_response(api.API())
self.assertNotEqual(result.body, "/cloud")
+ def test_query_api_version(self):
+ pass
-class APIStub(object):
- """Class to verify request and mark it was called."""
-
- @webob.dec.wsgify
- def __call__(self, req):
- return req.path_info
+if __name__ == '__main__':
+ unittest.main()
diff --git a/nova/tests/api/rackspace/__init__.py b/nova/tests/api/rackspace/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/nova/tests/api/rackspace/__init__.py
diff --git a/nova/tests/api/rackspace/flavors.py b/nova/tests/api/rackspace/flavors.py
new file mode 100644
index 000000000..fb8ba94a5
--- /dev/null
+++ b/nova/tests/api/rackspace/flavors.py
@@ -0,0 +1,34 @@
+# 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.
+
+import unittest
+
+from nova.api.rackspace import flavors
+from nova.tests.api.test_helper import *
+
+class FlavorsTest(unittest.TestCase):
+ def setUp(self):
+ self.stubs = stubout.StubOutForTesting()
+
+ def tearDown(self):
+ self.stubs.UnsetAll()
+
+ def test_get_flavor_list(self):
+ pass
+
+ def test_get_flavor_by_id(self):
+ pass
diff --git a/nova/tests/api/rackspace/images.py b/nova/tests/api/rackspace/images.py
new file mode 100644
index 000000000..560d8c898
--- /dev/null
+++ b/nova/tests/api/rackspace/images.py
@@ -0,0 +1,39 @@
+# 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.
+
+import unittest
+
+from nova.api.rackspace import images
+from nova.tests.api.test_helper import *
+
+class ImagesTest(unittest.TestCase):
+ def setUp(self):
+ self.stubs = stubout.StubOutForTesting()
+
+ def tearDown(self):
+ self.stubs.UnsetAll()
+
+ def test_get_image_list(self):
+ pass
+
+ def test_delete_image(self):
+ pass
+
+ def test_create_image(self):
+ pass
+
+
diff --git a/nova/tests/api/rackspace/servers.py b/nova/tests/api/rackspace/servers.py
new file mode 100644
index 000000000..6d628e78a
--- /dev/null
+++ b/nova/tests/api/rackspace/servers.py
@@ -0,0 +1,58 @@
+# 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.
+
+import unittest
+
+from nova.api.rackspace import servers
+from nova.tests.api.test_helper import *
+
+class ServersTest(unittest.TestCase):
+ def setUp(self):
+ self.stubs = stubout.StubOutForTesting()
+
+ def tearDown(self):
+ self.stubs.UnsetAll()
+
+ def test_get_server_list(self):
+ pass
+
+ def test_create_instance(self):
+ pass
+
+ def test_get_server_by_id(self):
+ pass
+
+ def test_get_backup_schedule(self):
+ pass
+
+ def test_get_server_details(self):
+ pass
+
+ def test_get_server_ips(self):
+ pass
+
+ def test_server_reboot(self):
+ pass
+
+ def test_server_rebuild(self):
+ pass
+
+ def test_server_resize(self):
+ pass
+
+ def test_delete_server_instance(self):
+ pass
diff --git a/nova/tests/api/rackspace/sharedipgroups.py b/nova/tests/api/rackspace/sharedipgroups.py
new file mode 100644
index 000000000..b4b281db7
--- /dev/null
+++ b/nova/tests/api/rackspace/sharedipgroups.py
@@ -0,0 +1,40 @@
+# 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.
+
+import unittest
+
+from nova.api.rackspace import sharedipgroups
+from nova.tests.api.test_helper import *
+
+class SharedIpGroupsTest(unittest.TestCase):
+ def setUp(self):
+ self.stubs = stubout.StubOutForTesting()
+
+ def tearDown(self):
+ self.stubs.UnsetAll()
+
+ def test_get_shared_ip_groups(self):
+ pass
+
+ def test_create_shared_ip_group(self):
+ pass
+
+ def test_delete_shared_ip_group(self):
+ pass
+
+
+
diff --git a/nova/tests/api/test_helper.py b/nova/tests/api/test_helper.py
new file mode 100644
index 000000000..8151a4af6
--- /dev/null
+++ b/nova/tests/api/test_helper.py
@@ -0,0 +1,7 @@
+import webob.dec
+
+class APIStub(object):
+ """Class to verify request and mark it was called."""
+ @webob.dec.wsgify
+ def __call__(self, req):
+ return req.path_info
diff --git a/nova/wsgi_test.py b/nova/tests/api/wsgi_test.py
index 786dc1bce..786dc1bce 100644
--- a/nova/wsgi_test.py
+++ b/nova/tests/api/wsgi_test.py