Skip to content

Commit

Permalink
Add positive image test case.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffmendoza committed Jun 18, 2015
1 parent 1dd44bd commit b110e31
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions appengine/images/tests/test_guestbook.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,22 @@ def test_post(self, mock_images):
self.assertEqual(response.status_int, 302)

def test_img(self):
greeting = main.Greeting(
parent=main.guestbook_key('default_guestbook'),
id=123,
)
greeting.author = 'asdf'
greeting.content = 'asdf'
greeting.put()

request = webapp2.Request.blank(
'/img?img_id=%s' % greeting.key.urlsafe()
)
response = request.get_response(main.app)

self.assertEqual(response.status_int, 200)

def test_img_missing(self):
# Bogus image id, should get error
request = webapp2.Request.blank('/img?img_id=123')
response = request.get_response(main.app)
Expand Down

0 comments on commit b110e31

Please sign in to comment.