Skip to content

Commit

Permalink
Merge pull request #56 from bboe/patch-1
Browse files Browse the repository at this point in the history
Use byte string as default in BodyMatcher
  • Loading branch information
sigmavirus24 committed Apr 12, 2015
2 parents 0cb2df6 + d8433b3 commit ffaf669
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion betamax/matchers/body.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ class BodyMatcher(BaseMatcher):

def match(self, request, recorded_request):
recorded_request = deserialize_prepared_request(recorded_request)
return recorded_request.body == (request.body or '')
return recorded_request.body == (request.body or b'')
4 changes: 2 additions & 2 deletions tests/unit/test_matchers.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def test_body_matcher(self):
'method': 'GET',
})
assert match(self.p, {
'body': '',
'body': b'',
'headers': {'User-Agent': 'betamax/test'},
'uri': 'http://example.com/path/to/end/point?query=string',
'method': 'GET',
Expand All @@ -66,7 +66,7 @@ def test_body_matcher_without_body(self):
'method': 'GET',
}) is False
assert match(p, {
'body': '',
'body': b'',
'headers': {'User-Agent': 'betamax/test'},
'uri': 'http://example.com/path/to/end/point?query=string',
'method': 'GET',
Expand Down

0 comments on commit ffaf669

Please sign in to comment.