Fix problem string comparison with unicode

Conflicts:
	test/integration/component/test_egress_fw_rules.py
This commit is contained in:
Girish Shilamkar 2014-03-27 19:00:27 -04:00
parent 00a4e6ada9
commit bf76012fba
1 changed files with 5 additions and 3 deletions

View File

@ -274,17 +274,19 @@ class TestEgressFWRules(cloudstackTestCase):
self.debug("script: %s" % script+exec_cmd_params)
self.debug("result: %s" % result)
if str(result).strip() == expected_result:
str_result = str(str(result).strip())
str_expected_result = str(expected_result).strip()
if str_result == str_expected_result:
exec_success = True
if negative_test:
self.assertEqual(exec_success,
True,
"Script result is %s matching with %s" % (result, expected_result))
"Script result is %s matching with %s" % (str_result, str_expected_result))
else:
self.assertEqual(exec_success,
True,
"Script result is %s is not matching with %s" % (result, expected_result))
"Script result is %s is not matching with %s" % (str_result, str_expected_result))
except Exception as e:
self.debug('Error=%s' % e)