heynemann/preggy — pull request #19 by rfloriano (2014-10-02 03:49:45+00:00)
Title: Fixed: Preggy raise an exception when trying to asset binary data in Python 3

When to_equal is used to compare file bytes data, it raise an error.
This patch fix this error.

Traceback:
======================================================================
ERROR: test_can_get_repository_contents_of_a_image (tests.test_client.TestGandalfClient)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/rafaelsilva/workspace/python/gandalf-client/tests/test_client.py", line 291, in test_can_get_repository_contents_of_a_image
expect(content).to_equal(img_file.read())
File "/Users/rafaelsilva/workspace/python/preggy/preggy/core.py", line 229, in _assert_topic
return _registered_assertions[method_name](self.topic, *args, **kw)
File "/Users/rafaelsilva/workspace/python/preggy/preggy/core.py", line 59, in wrapper
return func(*args, **kw)
File "/Users/rafaelsilva/workspace/python/preggy/preggy/core.py", line 126, in test_assertion
if not func(*args):
File "/Users/rafaelsilva/workspace/python/preggy/preggy/assertions/equality.py", line 22, in to_equal
topic = utils.fix_string(topic)
File "/Users/rafaelsilva/workspace/python/preggy/preggy/utils.py", line 57, in fix_string
return unidecode(obj)
File "/Users/rafaelsilva/workspace/python/preggy/preggy/.tox/py34/lib/python3.4/site-packages/unidecode/__init__.py", line 38, in unidecode
codepoint = ord(char)
nose.proxy.TypeError: ord() expected string of length 1, but int found