From 6c4f81516c6ad119d39c4952f3ab274f3d3f2efa Mon Sep 17 00:00:00 2001 From: Steve Martinelli Date: Fri, 17 Apr 2015 13:37:44 -0400 Subject: Re-organize functional tests The tests should be further divded by project version, similar to the structure of the unit tests. Change-Id: Ied3a4204983cdd253c5602a60968c066038d88f2 --- functional/tests/examples/__init__.py | 0 functional/tests/examples/test_examples.py | 28 ++++ functional/tests/identity/__init__.py | 0 functional/tests/identity/v2/__init__.py | 0 functional/tests/identity/v2/test_identity.py | 114 +++++++++++++++ functional/tests/identity/v3/__init__.py | 0 functional/tests/identity/v3/test_identity.py | 95 +++++++++++++ functional/tests/object/__init__.py | 0 functional/tests/object/v1/__init__.py | 0 functional/tests/object/v1/test_object.py | 94 +++++++++++++ functional/tests/test_examples.py | 28 ---- functional/tests/test_identity.py | 193 -------------------------- functional/tests/test_object.py | 94 ------------- 13 files changed, 331 insertions(+), 315 deletions(-) create mode 100644 functional/tests/examples/__init__.py create mode 100644 functional/tests/examples/test_examples.py create mode 100644 functional/tests/identity/__init__.py create mode 100644 functional/tests/identity/v2/__init__.py create mode 100644 functional/tests/identity/v2/test_identity.py create mode 100644 functional/tests/identity/v3/__init__.py create mode 100644 functional/tests/identity/v3/test_identity.py create mode 100644 functional/tests/object/__init__.py create mode 100644 functional/tests/object/v1/__init__.py create mode 100644 functional/tests/object/v1/test_object.py delete mode 100644 functional/tests/test_examples.py delete mode 100644 functional/tests/test_identity.py delete mode 100644 functional/tests/test_object.py (limited to 'functional') diff --git a/functional/tests/examples/__init__.py b/functional/tests/examples/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/functional/tests/examples/test_examples.py b/functional/tests/examples/test_examples.py new file mode 100644 index 00000000..6e0e5867 --- /dev/null +++ b/functional/tests/examples/test_examples.py @@ -0,0 +1,28 @@ +# 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. + +from functional.common import test + + +class ExampleTests(test.TestCase): + """Functional tests for running examples.""" + + def test_common(self): + # NOTE(stevemar): If an examples has a non-zero return + # code, then execute will raise an error by default. + test.execute('python', test.EXAMPLE_DIR + '/common.py --debug') + + def test_object_api(self): + test.execute('python', test.EXAMPLE_DIR + '/object_api.py --debug') + + def test_osc_lib(self): + test.execute('python', test.EXAMPLE_DIR + '/osc-lib.py --debug') diff --git a/functional/tests/identity/__init__.py b/functional/tests/identity/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/functional/tests/identity/v2/__init__.py b/functional/tests/identity/v2/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/functional/tests/identity/v2/test_identity.py b/functional/tests/identity/v2/test_identity.py new file mode 100644 index 00000000..37f29fc8 --- /dev/null +++ b/functional/tests/identity/v2/test_identity.py @@ -0,0 +1,114 @@ +# 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. + +from functional.common import exceptions +from functional.common import test + +BASIC_LIST_HEADERS = ['ID', 'Name'] + + +class IdentityV2Tests(test.TestCase): + """Functional tests for Identity V2 commands. """ + + USER_FIELDS = ['email', 'enabled', 'id', 'name', 'project_id', 'username'] + PROJECT_FIELDS = ['enabled', 'id', 'name', 'description'] + EC2_CREDENTIALS_FIELDS = [ + 'access', + 'project_id', + 'secret', + 'trust_id', + 'user_id', + ] + EC2_CREDENTIALS_LIST_HEADERS = [ + 'Access', + 'Secret', + 'Project ID', + 'User ID', + ] + + def test_user_list(self): + raw_output = self.openstack('user list') + items = self.parse_listing(raw_output) + self.assert_table_structure(items, BASIC_LIST_HEADERS) + + def test_user_show(self): + raw_output = self.openstack('user show admin') + items = self.parse_show(raw_output) + self.assert_show_fields(items, self.USER_FIELDS) + + def test_user_create(self): + raw_output = self.openstack('user create mjordan --password bulls' + ' --email hoops@example.com') + items = self.parse_show(raw_output) + self.assert_show_fields(items, self.USER_FIELDS) + + def test_user_delete(self): + self.openstack('user create dummy') + raw_output = self.openstack('user delete dummy') + self.assertEqual(0, len(raw_output)) + + def test_bad_user_command(self): + self.assertRaises(exceptions.CommandFailed, + self.openstack, 'user unlist') + + def test_project_list(self): + raw_output = self.openstack('project list') + items = self.parse_listing(raw_output) + self.assert_table_structure(items, BASIC_LIST_HEADERS) + + def test_project_show(self): + raw_output = self.openstack('project show admin') + items = self.parse_show(raw_output) + self.assert_show_fields(items, self.PROJECT_FIELDS) + + def test_project_create(self): + raw_output = self.openstack('project create test-project') + items = self.parse_show(raw_output) + self.assert_show_fields(items, self.PROJECT_FIELDS) + + def test_project_delete(self): + self.openstack('project create dummy-project') + raw_output = self.openstack('project delete dummy-project') + self.assertEqual(0, len(raw_output)) + + def test_ec2_credentials_create(self): + create_output = self.openstack('ec2 credentials create') + create_items = self.parse_show(create_output) + self.openstack( + 'ec2 credentials delete %s' % create_items[0]['access'], + ) + self.assert_show_fields(create_items, self.EC2_CREDENTIALS_FIELDS) + + def test_ec2_credentials_delete(self): + create_output = self.openstack('ec2 credentials create') + create_items = self.parse_show(create_output) + raw_output = self.openstack( + 'ec2 credentials delete %s' % create_items[0]['access'], + ) + self.assertEqual(0, len(raw_output)) + + def test_ec2_credentials_list(self): + raw_output = self.openstack('ec2 credentials list') + items = self.parse_listing(raw_output) + self.assert_table_structure(items, self.EC2_CREDENTIALS_LIST_HEADERS) + + def test_ec2_credentials_show(self): + create_output = self.openstack('ec2 credentials create') + create_items = self.parse_show(create_output) + show_output = self.openstack( + 'ec2 credentials show %s' % create_items[0]['access'], + ) + items = self.parse_show(show_output) + self.openstack( + 'ec2 credentials delete %s' % create_items[0]['access'], + ) + self.assert_show_fields(items, self.EC2_CREDENTIALS_FIELDS) diff --git a/functional/tests/identity/v3/__init__.py b/functional/tests/identity/v3/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/functional/tests/identity/v3/test_identity.py b/functional/tests/identity/v3/test_identity.py new file mode 100644 index 00000000..82319085 --- /dev/null +++ b/functional/tests/identity/v3/test_identity.py @@ -0,0 +1,95 @@ +# 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 os +import uuid + +from functional.common import exceptions +from functional.common import test + +BASIC_LIST_HEADERS = ['ID', 'Name'] + + +class IdentityV3Tests(test.TestCase): + """Functional tests for Identity V3 commands. """ + + DOMAIN_FIELDS = ['description', 'enabled', 'id', 'name', 'links'] + GROUP_FIELDS = ['description', 'domain_id', 'id', 'name', 'links'] + TOKEN_FIELDS = ['expires', 'id', 'project_id', 'user_id'] + + def _create_dummy_group(self): + name = uuid.uuid4().hex + self.openstack('group create ' + name) + return name + + def _create_dummy_domain(self): + name = uuid.uuid4().hex + self.openstack('domain create ' + name) + return name + + def setUp(self): + super(IdentityV3Tests, self).setUp() + auth_url = os.environ.get('OS_AUTH_URL') + auth_url = auth_url.replace('v2.0', 'v3') + os.environ['OS_AUTH_URL'] = auth_url + os.environ['OS_IDENTITY_API_VERSION'] = '3' + os.environ['OS_USER_DOMAIN_ID'] = 'default' + os.environ['OS_PROJECT_DOMAIN_ID'] = 'default' + + def test_group_create(self): + raw_output = self.openstack('group create ' + uuid.uuid4().hex) + items = self.parse_show(raw_output) + self.assert_show_fields(items, self.GROUP_FIELDS) + + def test_group_list(self): + self._create_dummy_group() + raw_output = self.openstack('group list') + items = self.parse_listing(raw_output) + self.assert_table_structure(items, BASIC_LIST_HEADERS) + + def test_group_delete(self): + name = self._create_dummy_group() + raw_output = self.openstack('group delete ' + name) + self.assertEqual(0, len(raw_output)) + + def test_group_show(self): + name = self._create_dummy_group() + raw_output = self.openstack('group show ' + name) + items = self.parse_show(raw_output) + self.assert_show_fields(items, self.GROUP_FIELDS) + + def test_domain_create(self): + raw_output = self.openstack('domain create ' + uuid.uuid4().hex) + items = self.parse_show(raw_output) + self.assert_show_fields(items, self.DOMAIN_FIELDS) + + def test_domain_list(self): + self._create_dummy_domain() + raw_output = self.openstack('domain list') + items = self.parse_listing(raw_output) + self.assert_table_structure(items, BASIC_LIST_HEADERS) + + def test_domain_delete(self): + name = self._create_dummy_domain() + self.assertRaises(exceptions.CommandFailed, + self.openstack, 'domain delete ' + name) + + def test_domain_show(self): + name = self._create_dummy_domain() + raw_output = self.openstack('domain show ' + name) + items = self.parse_show(raw_output) + self.assert_show_fields(items, self.DOMAIN_FIELDS) + + def test_token_issue(self): + raw_output = self.openstack('token issue') + items = self.parse_show(raw_output) + self.assert_show_fields(items, self.TOKEN_FIELDS) diff --git a/functional/tests/object/__init__.py b/functional/tests/object/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/functional/tests/object/v1/__init__.py b/functional/tests/object/v1/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/functional/tests/object/v1/test_object.py b/functional/tests/object/v1/test_object.py new file mode 100644 index 00000000..4121524a --- /dev/null +++ b/functional/tests/object/v1/test_object.py @@ -0,0 +1,94 @@ +# 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 os +import uuid + +from functional.common import test + +BASIC_LIST_HEADERS = ['Name'] +CONTAINER_FIELDS = ['account', 'container', 'x-trans-id'] +OBJECT_FIELDS = ['object', 'container', 'etag'] + + +class ObjectV1Tests(test.TestCase): + """Functional tests for Object V1 commands. """ + + CONTAINER_NAME = uuid.uuid4().hex + OBJECT_NAME = uuid.uuid4().hex + + def setUp(self): + super(ObjectV1Tests, self).setUp() + self.addCleanup(os.remove, self.OBJECT_NAME) + with open(self.OBJECT_NAME, 'w') as f: + f.write('test content') + + def test_container_create(self): + raw_output = self.openstack('container create ' + self.CONTAINER_NAME) + items = self.parse_listing(raw_output) + self.assert_show_fields(items, CONTAINER_FIELDS) + + def test_container_delete(self): + container_tmp = uuid.uuid4().hex + self.openstack('container create ' + container_tmp) + raw_output = self.openstack('container delete ' + container_tmp) + self.assertEqual(0, len(raw_output)) + + def test_container_list(self): + raw_output = self.openstack('container list') + items = self.parse_listing(raw_output) + self.assert_table_structure(items, BASIC_LIST_HEADERS) + + def test_container_show(self): + self.openstack('container show ' + self.CONTAINER_NAME) + # TODO(stevemar): Assert returned fields + + def test_container_save(self): + self.openstack('container save ' + self.CONTAINER_NAME) + # TODO(stevemar): Assert returned fields + + def test_object_create(self): + raw_output = self.openstack('object create ' + self.CONTAINER_NAME + + ' ' + self.OBJECT_NAME) + items = self.parse_listing(raw_output) + self.assert_show_fields(items, OBJECT_FIELDS) + + def test_object_delete(self): + raw_output = self.openstack('object delete ' + self.CONTAINER_NAME + + ' ' + self.OBJECT_NAME) + self.assertEqual(0, len(raw_output)) + + def test_object_list(self): + raw_output = self.openstack('object list ' + self.CONTAINER_NAME) + items = self.parse_listing(raw_output) + self.assert_table_structure(items, BASIC_LIST_HEADERS) + + def test_object_save(self): + self.openstack('object create ' + self.CONTAINER_NAME + + ' ' + self.OBJECT_NAME) + self.openstack('object save ' + self.CONTAINER_NAME + + ' ' + self.OBJECT_NAME) + # TODO(stevemar): Assert returned fields + + def test_object_save_with_filename(self): + self.openstack('object create ' + self.CONTAINER_NAME + + ' ' + self.OBJECT_NAME) + self.openstack('object save ' + self.CONTAINER_NAME + + ' ' + self.OBJECT_NAME + ' --file tmp.txt') + # TODO(stevemar): Assert returned fields + + def test_object_show(self): + self.openstack('object create ' + self.CONTAINER_NAME + + ' ' + self.OBJECT_NAME) + self.openstack('object show ' + self.CONTAINER_NAME + + ' ' + self.OBJECT_NAME) + # TODO(stevemar): Assert returned fields diff --git a/functional/tests/test_examples.py b/functional/tests/test_examples.py deleted file mode 100644 index 6e0e5867..00000000 --- a/functional/tests/test_examples.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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. - -from functional.common import test - - -class ExampleTests(test.TestCase): - """Functional tests for running examples.""" - - def test_common(self): - # NOTE(stevemar): If an examples has a non-zero return - # code, then execute will raise an error by default. - test.execute('python', test.EXAMPLE_DIR + '/common.py --debug') - - def test_object_api(self): - test.execute('python', test.EXAMPLE_DIR + '/object_api.py --debug') - - def test_osc_lib(self): - test.execute('python', test.EXAMPLE_DIR + '/osc-lib.py --debug') diff --git a/functional/tests/test_identity.py b/functional/tests/test_identity.py deleted file mode 100644 index b3281154..00000000 --- a/functional/tests/test_identity.py +++ /dev/null @@ -1,193 +0,0 @@ -# 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 os -import uuid - -from functional.common import exceptions -from functional.common import test - -BASIC_LIST_HEADERS = ['ID', 'Name'] - - -class IdentityV2Tests(test.TestCase): - """Functional tests for Identity V2 commands. """ - - USER_FIELDS = ['email', 'enabled', 'id', 'name', 'project_id', 'username'] - PROJECT_FIELDS = ['enabled', 'id', 'name', 'description'] - EC2_CREDENTIALS_FIELDS = [ - 'access', - 'project_id', - 'secret', - 'trust_id', - 'user_id', - ] - EC2_CREDENTIALS_LIST_HEADERS = [ - 'Access', - 'Secret', - 'Project ID', - 'User ID', - ] - - def test_user_list(self): - raw_output = self.openstack('user list') - items = self.parse_listing(raw_output) - self.assert_table_structure(items, BASIC_LIST_HEADERS) - - def test_user_show(self): - raw_output = self.openstack('user show admin') - items = self.parse_show(raw_output) - self.assert_show_fields(items, self.USER_FIELDS) - - def test_user_create(self): - raw_output = self.openstack('user create mjordan --password bulls' - ' --email hoops@example.com') - items = self.parse_show(raw_output) - self.assert_show_fields(items, self.USER_FIELDS) - - def test_user_delete(self): - self.openstack('user create dummy') - raw_output = self.openstack('user delete dummy') - self.assertEqual(0, len(raw_output)) - - def test_bad_user_command(self): - self.assertRaises(exceptions.CommandFailed, - self.openstack, 'user unlist') - - def test_project_list(self): - raw_output = self.openstack('project list') - items = self.parse_listing(raw_output) - self.assert_table_structure(items, BASIC_LIST_HEADERS) - - def test_project_show(self): - raw_output = self.openstack('project show admin') - items = self.parse_show(raw_output) - self.assert_show_fields(items, self.PROJECT_FIELDS) - - def test_project_create(self): - raw_output = self.openstack('project create test-project') - items = self.parse_show(raw_output) - self.assert_show_fields(items, self.PROJECT_FIELDS) - - def test_project_delete(self): - self.openstack('project create dummy-project') - raw_output = self.openstack('project delete dummy-project') - self.assertEqual(0, len(raw_output)) - - def test_ec2_credentials_create(self): - create_output = self.openstack('ec2 credentials create') - create_items = self.parse_show(create_output) - self.openstack( - 'ec2 credentials delete %s' % create_items[0]['access'], - ) - self.assert_show_fields(create_items, self.EC2_CREDENTIALS_FIELDS) - - def test_ec2_credentials_delete(self): - create_output = self.openstack('ec2 credentials create') - create_items = self.parse_show(create_output) - raw_output = self.openstack( - 'ec2 credentials delete %s' % create_items[0]['access'], - ) - self.assertEqual(0, len(raw_output)) - - def test_ec2_credentials_list(self): - raw_output = self.openstack('ec2 credentials list') - items = self.parse_listing(raw_output) - self.assert_table_structure(items, self.EC2_CREDENTIALS_LIST_HEADERS) - - def test_ec2_credentials_show(self): - create_output = self.openstack('ec2 credentials create') - create_items = self.parse_show(create_output) - show_output = self.openstack( - 'ec2 credentials show %s' % create_items[0]['access'], - ) - items = self.parse_show(show_output) - self.openstack( - 'ec2 credentials delete %s' % create_items[0]['access'], - ) - self.assert_show_fields(items, self.EC2_CREDENTIALS_FIELDS) - - -class IdentityV3Tests(test.TestCase): - """Functional tests for Identity V3 commands. """ - - DOMAIN_FIELDS = ['description', 'enabled', 'id', 'name', 'links'] - GROUP_FIELDS = ['description', 'domain_id', 'id', 'name', 'links'] - TOKEN_FIELDS = ['expires', 'id', 'project_id', 'user_id'] - - def _create_dummy_group(self): - name = uuid.uuid4().hex - self.openstack('group create ' + name) - return name - - def _create_dummy_domain(self): - name = uuid.uuid4().hex - self.openstack('domain create ' + name) - return name - - def setUp(self): - super(IdentityV3Tests, self).setUp() - auth_url = os.environ.get('OS_AUTH_URL') - auth_url = auth_url.replace('v2.0', 'v3') - os.environ['OS_AUTH_URL'] = auth_url - os.environ['OS_IDENTITY_API_VERSION'] = '3' - os.environ['OS_USER_DOMAIN_ID'] = 'default' - os.environ['OS_PROJECT_DOMAIN_ID'] = 'default' - - def test_group_create(self): - raw_output = self.openstack('group create ' + uuid.uuid4().hex) - items = self.parse_show(raw_output) - self.assert_show_fields(items, self.GROUP_FIELDS) - - def test_group_list(self): - self._create_dummy_group() - raw_output = self.openstack('group list') - items = self.parse_listing(raw_output) - self.assert_table_structure(items, BASIC_LIST_HEADERS) - - def test_group_delete(self): - name = self._create_dummy_group() - raw_output = self.openstack('group delete ' + name) - self.assertEqual(0, len(raw_output)) - - def test_group_show(self): - name = self._create_dummy_group() - raw_output = self.openstack('group show ' + name) - items = self.parse_show(raw_output) - self.assert_show_fields(items, self.GROUP_FIELDS) - - def test_domain_create(self): - raw_output = self.openstack('domain create ' + uuid.uuid4().hex) - items = self.parse_show(raw_output) - self.assert_show_fields(items, self.DOMAIN_FIELDS) - - def test_domain_list(self): - self._create_dummy_domain() - raw_output = self.openstack('domain list') - items = self.parse_listing(raw_output) - self.assert_table_structure(items, BASIC_LIST_HEADERS) - - def test_domain_delete(self): - name = self._create_dummy_domain() - self.assertRaises(exceptions.CommandFailed, - self.openstack, 'domain delete ' + name) - - def test_domain_show(self): - name = self._create_dummy_domain() - raw_output = self.openstack('domain show ' + name) - items = self.parse_show(raw_output) - self.assert_show_fields(items, self.DOMAIN_FIELDS) - - def test_token_issue(self): - raw_output = self.openstack('token issue') - items = self.parse_show(raw_output) - self.assert_show_fields(items, self.TOKEN_FIELDS) diff --git a/functional/tests/test_object.py b/functional/tests/test_object.py deleted file mode 100644 index 4121524a..00000000 --- a/functional/tests/test_object.py +++ /dev/null @@ -1,94 +0,0 @@ -# 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 os -import uuid - -from functional.common import test - -BASIC_LIST_HEADERS = ['Name'] -CONTAINER_FIELDS = ['account', 'container', 'x-trans-id'] -OBJECT_FIELDS = ['object', 'container', 'etag'] - - -class ObjectV1Tests(test.TestCase): - """Functional tests for Object V1 commands. """ - - CONTAINER_NAME = uuid.uuid4().hex - OBJECT_NAME = uuid.uuid4().hex - - def setUp(self): - super(ObjectV1Tests, self).setUp() - self.addCleanup(os.remove, self.OBJECT_NAME) - with open(self.OBJECT_NAME, 'w') as f: - f.write('test content') - - def test_container_create(self): - raw_output = self.openstack('container create ' + self.CONTAINER_NAME) - items = self.parse_listing(raw_output) - self.assert_show_fields(items, CONTAINER_FIELDS) - - def test_container_delete(self): - container_tmp = uuid.uuid4().hex - self.openstack('container create ' + container_tmp) - raw_output = self.openstack('container delete ' + container_tmp) - self.assertEqual(0, len(raw_output)) - - def test_container_list(self): - raw_output = self.openstack('container list') - items = self.parse_listing(raw_output) - self.assert_table_structure(items, BASIC_LIST_HEADERS) - - def test_container_show(self): - self.openstack('container show ' + self.CONTAINER_NAME) - # TODO(stevemar): Assert returned fields - - def test_container_save(self): - self.openstack('container save ' + self.CONTAINER_NAME) - # TODO(stevemar): Assert returned fields - - def test_object_create(self): - raw_output = self.openstack('object create ' + self.CONTAINER_NAME - + ' ' + self.OBJECT_NAME) - items = self.parse_listing(raw_output) - self.assert_show_fields(items, OBJECT_FIELDS) - - def test_object_delete(self): - raw_output = self.openstack('object delete ' + self.CONTAINER_NAME - + ' ' + self.OBJECT_NAME) - self.assertEqual(0, len(raw_output)) - - def test_object_list(self): - raw_output = self.openstack('object list ' + self.CONTAINER_NAME) - items = self.parse_listing(raw_output) - self.assert_table_structure(items, BASIC_LIST_HEADERS) - - def test_object_save(self): - self.openstack('object create ' + self.CONTAINER_NAME - + ' ' + self.OBJECT_NAME) - self.openstack('object save ' + self.CONTAINER_NAME - + ' ' + self.OBJECT_NAME) - # TODO(stevemar): Assert returned fields - - def test_object_save_with_filename(self): - self.openstack('object create ' + self.CONTAINER_NAME - + ' ' + self.OBJECT_NAME) - self.openstack('object save ' + self.CONTAINER_NAME - + ' ' + self.OBJECT_NAME + ' --file tmp.txt') - # TODO(stevemar): Assert returned fields - - def test_object_show(self): - self.openstack('object create ' + self.CONTAINER_NAME - + ' ' + self.OBJECT_NAME) - self.openstack('object show ' + self.CONTAINER_NAME - + ' ' + self.OBJECT_NAME) - # TODO(stevemar): Assert returned fields -- cgit v1.2.1