diff options
author | Ethan Lynn <xjunlin@cn.ibm.com> | 2014-07-25 14:08:41 +0800 |
---|---|---|
committer | Ethan Lynn <xjunlin@cn.ibm.com> | 2014-07-29 10:34:26 +0800 |
commit | 10a00d3ee4735bd88c6afbefc1b4a7b63104b060 (patch) | |
tree | a0e16df25b72f97521ee2128fb9b35f4974f170e /heat/tests/test_volume.py | |
parent | 70c36b9afade0ca547f565806a7a5478c1d69f56 (diff) | |
download | heat-10a00d3ee4735bd88c6afbefc1b4a7b63104b060.tar.gz |
Replace str() with six.text_type() where exception is used
When switching to oslo.i18n, tests where used str(exc) will failed
with unicodeerror, so before switching to oslo.i18n, need to
replace str with six.text_type where exception is used. And it's
recommanded to use six.text_type instead of str in openstack.
Change-Id: Ie37a6ef74a12b2580ce72afc75c99bcd19d4cf97
Diffstat (limited to 'heat/tests/test_volume.py')
-rw-r--r-- | heat/tests/test_volume.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/heat/tests/test_volume.py b/heat/tests/test_volume.py index d4b12e0d1..c398b8a57 100644 --- a/heat/tests/test_volume.py +++ b/heat/tests/test_volume.py @@ -862,7 +862,7 @@ class VolumeTest(HeatTestCase): rsrc.validate) self.assertEqual( "Property error : DataVolume: size 0 is out of " - "range (min: 1, max: None)", str(error)) + "range (min: 1, max: None)", six.text_type(error)) def test_volume_size_constraint_aws(self): t = template_format.parse(volume_template) @@ -875,7 +875,7 @@ class VolumeTest(HeatTestCase): rsrc.validate) self.assertEqual( "Property error : DataVolume: Size 0 is out of " - "range (min: 1, max: None)", str(error)) + "range (min: 1, max: None)", six.text_type(error)) def test_cinder_create_from_image(self): fv = FakeVolumeWithStateTransition('downloading', 'available') @@ -998,7 +998,7 @@ class VolumeTest(HeatTestCase): rsrc.FnGetAtt, 'unknown') self.assertEqual( 'The Referenced Attribute (DataVolume unknown) is incorrect.', - str(error)) + six.text_type(error)) self.m.VerifyAll() |