Skip to content

Commit c48772b

Browse files
author
Jon Wayne Parrott
committed
Some improvements to images test case coverage (this needs to be revisited and updated to webtest)
1 parent 73d220c commit c48772b

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

appengine/images/tests/test_guestbook.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ def setUp(self):
2828
reload(main)
2929

3030
def test_get(self):
31+
main.Greeting(
32+
parent=main.guestbook_key('default_guestbook'),
33+
author='123',
34+
content='abc'
35+
).put()
36+
3137
# Build a request object passing the URI path to be tested.
3238
# You can also pass headers, query arguments etc.
3339
request = webapp2.Request.blank('/')
@@ -43,7 +49,7 @@ def test_post(self, mock_images):
4349
request = webapp2.Request.blank(
4450
'/sign',
4551
POST={'content': 'asdf'},
46-
)
52+
)
4753
response = request.get_response(main.app)
4854
mock_images.resize.assert_called_once_with(mock.ANY, 32, 32)
4955

@@ -53,10 +59,11 @@ def test_post(self, mock_images):
5359
def test_img(self):
5460
greeting = main.Greeting(
5561
parent=main.guestbook_key('default_guestbook'),
56-
id=123,
62+
id=123
5763
)
5864
greeting.author = 'asdf'
5965
greeting.content = 'asdf'
66+
greeting.avatar = b'123'
6067
greeting.put()
6168

6269
request = webapp2.Request.blank(
@@ -79,7 +86,7 @@ def test_post_and_get(self, mock_images):
7986
request = webapp2.Request.blank(
8087
'/sign',
8188
POST={'content': 'asdf'},
82-
)
89+
)
8390
response = request.get_response(main.app)
8491

8592
request = webapp2.Request.blank('/')

0 commit comments

Comments
 (0)