Python3: fix 2 unit test cases

This commit is contained in:
Tianhao He
2015-09-29 17:27:24 -07:00
parent e26718fef6
commit 49c6d5157d
2 changed files with 4 additions and 4 deletions

View File

@@ -64,10 +64,10 @@ class Iso8601Tests(tests.VCRTestBase):
def has_tag(doc): def has_tag(doc):
if doc is None: if doc is None:
return False return False
return '<dateTime>' in doc return '<dateTime>' in doc.decode("utf-8")
def correct_time_string(doc): def correct_time_string(doc):
return '<dateTime>{0}</dateTime>'.format(now_string) in doc return '<dateTime>{0}</dateTime>'.format(now_string) in doc.decode("utf-8")
def check_date_time_value(r1, r2): def check_date_time_value(r1, r2):
for r in [r1, r2]: for r in [r1, r2]:

View File

@@ -31,7 +31,7 @@ class SerializerTests(tests.VCRTestBase):
'</_this>' '</_this>'
'</RetrieveServiceContent>' '</RetrieveServiceContent>'
'</soapenv:Body>') '</soapenv:Body>')
if soap_msg in r1.body: if soap_msg in r1.body.decode("utf-8"):
return True return True
raise SystemError('serialization error occurred') raise SystemError('serialization error occurred')
@@ -51,4 +51,4 @@ class SerializerTests(tests.VCRTestBase):
self.assertTrue(content is not None) self.assertTrue(content is not None)
self.assertTrue( self.assertTrue(
'<_this type="ServiceInstance">ServiceInstance</_this>' '<_this type="ServiceInstance">ServiceInstance</_this>'
in cass.requests[0].body) in cass.requests[0].body.decode("utf-8"))