Skip to content

Commit a6ea6d9

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "Add image functional tests"
2 parents c2e8b80 + 746f642 commit a6ea6d9

5 files changed

Lines changed: 47 additions & 2 deletions

File tree

‎functional/common/test.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def get_show_opts(cls, fields=[]):
5656

5757
@classmethod
5858
def get_list_opts(cls, headers=[]):
59-
opts = ' -f csv --quote none '
59+
opts = ' -f csv '
6060
opts = opts + ' '.join(['-c ' + it for it in headers])
6161
return opts
6262

‎functional/tests/image/__init__.py‎

Whitespace-only changes.

‎functional/tests/image/v1/__init__.py‎

Whitespace-only changes.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
2+
# not use this file except in compliance with the License. You may obtain
3+
# a copy of the License at
4+
#
5+
# http://www.apache.org/licenses/LICENSE-2.0
6+
#
7+
# Unless required by applicable law or agreed to in writing, software
8+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10+
# License for the specific language governing permissions and limitations
11+
# under the License.
12+
13+
import uuid
14+
15+
from functional.common import test
16+
17+
18+
class ImageTests(test.TestCase):
19+
"""Functional tests for image. """
20+
21+
NAME = uuid.uuid4().hex
22+
HEADERS = ['Name']
23+
FIELDS = ['name']
24+
25+
@classmethod
26+
def setUpClass(cls):
27+
opts = cls.get_show_opts(cls.FIELDS)
28+
raw_output = cls.openstack('image create ' + cls.NAME + opts)
29+
expected = cls.NAME + '\n'
30+
cls.assertOutput(expected, raw_output)
31+
32+
@classmethod
33+
def tearDownClass(cls):
34+
raw_output = cls.openstack('image delete ' + cls.NAME)
35+
cls.assertOutput('', raw_output)
36+
37+
def test_image_list(self):
38+
opts = self.get_list_opts(self.HEADERS)
39+
raw_output = self.openstack('image list' + opts)
40+
self.assertIn(self.NAME, raw_output)
41+
42+
def test_image_show(self):
43+
opts = self.get_show_opts(self.FIELDS)
44+
raw_output = self.openstack('image show ' + self.NAME + opts)
45+
self.assertEqual(self.NAME + "\n", raw_output)

‎functional/tests/object/v1/test_container.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class ContainerTests(test.TestCase):
2323
def setUpClass(cls):
2424
opts = cls.get_list_opts(['container'])
2525
raw_output = cls.openstack('container create ' + cls.NAME + opts)
26-
expected = 'container\n' + cls.NAME + '\n'
26+
expected = '"container"\n"' + cls.NAME + '"\n'
2727
cls.assertOutput(expected, raw_output)
2828

2929
@classmethod

0 commit comments

Comments
 (0)