Skip to content
This repository has been archived by the owner on Feb 13, 2019. It is now read-only.

Commit

Permalink
Hacking up the tests for python 3
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Sinchok committed Apr 14, 2014
1 parent d103dbb commit 97a18a2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
1 change: 0 additions & 1 deletion betty/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ def _save(self, image_id, content):

r = requests.post(endpoint, data=data, files=files, headers=self.auth_headers)
if r.status_code != 200:
print(r.content)
raise IOError("Save failed")

return str(r.json()["id"])
Expand Down
33 changes: 17 additions & 16 deletions tests/test_image_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,30 @@

TEST_DATA_PATH = os.path.join(os.path.dirname(__file__), 'images')

TEST_IMAGE_DATA = json.dumps({
"id": 12345,
"name": "Lenna.png",
"width": 512,
"height": 512,
"credit": "Lena Soderberg",
"selections": {}
}).encode("UTF-8")


@urlmatch(path=r'.*api/new$')
def betty_new_mock(url, request):
return json.dumps({
"id": 12345,
"name": "Lenna.png",
"width": 512,
"height": 512,
"credit": "Lena Soderberg",
"selections": {}
})
return {
"status_code": 200,
"content": TEST_IMAGE_DATA
}


@urlmatch(path=r'.*api/12345.*$')
def betty_detail_mock(url, request):
return json.dumps({
"id": 12345,
"name": "Lenna.png",
"width": 512,
"height": 512,
"credit": "Lena Soderberg",
"selections": {}
})
return {
"status_code": 200,
"content": TEST_IMAGE_DATA
}


class ImageFieldTestCase(TestCase):
Expand Down

0 comments on commit 97a18a2

Please sign in to comment.