Commit 409414c5 authored by Rafael Monnerat's avatar Rafael Monnerat

py3: No need decode/encode same string

parent a4bbc371
...@@ -969,9 +969,7 @@ class SlapOSTestCaseMixin(testSlapOSMixin): ...@@ -969,9 +969,7 @@ class SlapOSTestCaseMixin(testSlapOSMixin):
def generateSafeXml(self): def generateSafeXml(self):
return '<?xml version="1.0" encoding="utf-8"?><instance><parameter '\ return '<?xml version="1.0" encoding="utf-8"?><instance><parameter '\
'id="%s">%s</parameter></instance>' % \ 'id="paramé">%s</parameter></instance>' % self.generateNewId()
("paramé".decode("UTF-8").encode("UTF-8"),
self.generateNewId().decode("UTF-8").encode("UTF-8"))
def generateEmptyXml(self): def generateEmptyXml(self):
return '<?xml version="1.0" encoding="utf-8"?><instance></instance>' return '<?xml version="1.0" encoding="utf-8"?><instance></instance>'
......
...@@ -897,9 +897,7 @@ class TestSlapOSCloudInstanceInvalidRequest(SlapOSTestCaseMixin): ...@@ -897,9 +897,7 @@ class TestSlapOSCloudInstanceInvalidRequest(SlapOSTestCaseMixin):
def generateUnsafeXml_bad_string(self): def generateUnsafeXml_bad_string(self):
return '<?xml version="1.0" encoding="utf-8"?><instance><parameter '\ return '<?xml version="1.0" encoding="utf-8"?><instance><parameter '\
'id="%s">%s\x08</parameter></instance>' % \ 'id="paramé">%s\x08</parameter></instance>' % self.generateNewId()
("paramé".decode("UTF-8").encode("UTF-8"),
self.generateNewId().decode("UTF-8").encode("UTF-8"))
def _test_invalid(self, title=None, instance_xml=None, sla_xml=None, shared=False): def _test_invalid(self, title=None, instance_xml=None, sla_xml=None, shared=False):
self._makeComputeNode(self.project) self._makeComputeNode(self.project)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment