Fix PY2/PY3 specific error in testcases
Use 'six.text_type' to wrap defined string value. Change-Id: I229d58595494f59f03538be79de42f2e8007f442 Closes-Bug: #1697401
This commit is contained in:
@@ -10,6 +10,7 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
import six
|
||||||
|
|
||||||
from cinderclient.tests.functional import base
|
from cinderclient.tests.functional import base
|
||||||
|
|
||||||
@@ -42,10 +43,11 @@ class CinderSnapshotTests(base.ClientTestBase):
|
|||||||
2) create snapshot with metadata
|
2) create snapshot with metadata
|
||||||
3) check that metadata complies entered
|
3) check that metadata complies entered
|
||||||
"""
|
"""
|
||||||
snapshot = self.object_create('snapshot',
|
snapshot = self.object_create(
|
||||||
params='--metadata test_metadata=test_date {0}'.
|
'snapshot',
|
||||||
format(self.volume['id']))
|
params='--metadata test_metadata=test_date {0}'.format(
|
||||||
self.assertEqual("{u'test_metadata': u'test_date'}",
|
self.volume['id']))
|
||||||
|
self.assertEqual(six.text_type({u'test_metadata': u'test_date'}),
|
||||||
snapshot['metadata'])
|
snapshot['metadata'])
|
||||||
self.object_delete('snapshot', snapshot['id'])
|
self.object_delete('snapshot', snapshot['id'])
|
||||||
self.check_object_deleted('snapshot', snapshot['id'])
|
self.check_object_deleted('snapshot', snapshot['id'])
|
||||||
|
@@ -108,7 +108,7 @@ class CinderVolumeTestsWithParameters(base.ClientTestBase):
|
|||||||
1) create volume with metadata
|
1) create volume with metadata
|
||||||
2) check that metadata complies entered
|
2) check that metadata complies entered
|
||||||
"""
|
"""
|
||||||
volume = self.object_create('volume',
|
volume = self.object_create(
|
||||||
params='--metadata test_metadata=test_date 1')
|
'volume', params='--metadata test_metadata=test_date 1')
|
||||||
self.assertEqual("{u'test_metadata': u'test_date'}",
|
self.assertEqual(six.text_type({u'test_metadata': u'test_date'}),
|
||||||
volume['metadata'])
|
volume['metadata'])
|
||||||
|
Reference in New Issue
Block a user