add missing return to Py3kObject
This commit is contained in:
@@ -61,7 +61,7 @@ class Py3kObject(object):
|
||||
if PY3:
|
||||
return ret
|
||||
else:
|
||||
ret.encode('utf-8')
|
||||
return ret.encode('utf-8')
|
||||
|
||||
from datetime import datetime
|
||||
from datetime import timedelta
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from sure import expect
|
||||
from httpretty import HTTPretty, HTTPrettyError, STATUSES, URIInfo
|
||||
from httpretty import HTTPretty, HTTPrettyError, STATUSES, URIInfo, Py3kObject
|
||||
|
||||
|
||||
def test_httpretty_should_raise_proper_exception_on_inconsistent_length():
|
||||
@@ -160,3 +160,12 @@ def test_global_boolean_enabled():
|
||||
expect(HTTPretty.is_enabled()).to.be.truthy
|
||||
HTTPretty.disable()
|
||||
expect(HTTPretty.is_enabled()).to.be.falsy
|
||||
|
||||
|
||||
def test_py3kobject_implements_valid__repr__based_on__str__():
|
||||
class MyObject(Py3kObject):
|
||||
def __str__(self):
|
||||
return 'hi'
|
||||
|
||||
myobj = MyObject()
|
||||
expect(repr(myobj)).to.be.equal('hi')
|
||||
|
||||
Reference in New Issue
Block a user