Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Code review changes for Bugfix for lp904407, /extensions tests
Change-Id: I882f8170c69e5fb3690288a4a763ec2090e5167a
- Loading branch information
donald-ngo
committed
Dec 15, 2011
1 parent
876adb2
commit 20b6bca
Showing
3 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from tempest.common import rest_client | ||
import json | ||
|
||
|
||
class ExtensionsClient(object): | ||
|
||
def __init__(self, config, username, key, auth_url, tenant_name=None): | ||
self.config = config | ||
self.client = rest_client.RestClient(config, username, key, | ||
auth_url, tenant_name) | ||
|
||
def list_extensions(self): | ||
url = 'extensions' | ||
resp, body = self.client.get(url) | ||
body = json.loads(body) | ||
return resp, body |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from nose.plugins.attrib import attr | ||
from tempest import openstack | ||
import tempest.config | ||
import unittest2 as unittest | ||
|
||
|
||
class ExtentionsTest(unittest.TestCase): | ||
|
||
@classmethod | ||
def setUpClass(cls): | ||
cls.os = openstack.Manager() | ||
cls.client = cls.os.extensions_client | ||
cls.config = cls.os.config | ||
|
||
@attr(type='smoke') | ||
def test_list_extensions(self): | ||
"""List of all extensions""" | ||
resp, extensions = self.client.list_extensions() | ||
self.assertTrue("extensions" in extensions) | ||
self.assertEqual(200, resp.status) |