add missing return to Py3kObject

This commit is contained in:
Igor Sobreira
2013-04-02 05:25:06 +00:00
parent 932f2a80fc
commit c3525c0213
2 changed files with 11 additions and 2 deletions

View File

@@ -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

View File

@@ -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')