Skip to content

Commit e427a88

Browse files
author
Jonathan Wayne Parrott
committed
Merge pull request #81 from GoogleCloudPlatform/cleanup-3
Various cleanups
2 parents 80fa339 + d9ea86a commit e427a88

File tree

16 files changed

+74
-14
lines changed

16 files changed

+74
-14
lines changed

.coveragerc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ include =
1010
[report]
1111
exclude_lines =
1212
pragma: NO COVER
13+
if __name__ == '__main__':

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('/')

appengine/localtesting/test_datastore.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def GetEntityViaMemcache(entity_key):
4747

4848

4949
# [START datastore_example_test]
50-
class DatstoreTestCase(unittest.TestCase):
50+
class DatastoreTestCase(unittest.TestCase):
5151

5252
def setUp(self):
5353
# First, create an instance of the Testbed class.

blog/__init__.py

Whitespace-only changes.

blog/introduction-to-data-models-in-cloud-datastore/README.md renamed to blog/introduction_to_data_models_in_cloud_datastore/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Introduction to data models in Cloud Datastore
22

33
This sample code is used in [this blog post](). It demonstrates two data models
4-
using [Google Cloud Datstore](https://cloud.google.com/datastore).
4+
using [Google Cloud Datastore](https://cloud.google.com/datastore).
55

66
## Prerequisites
77

blog/introduction_to_data_models_in_cloud_datastore/__init__.py

Whitespace-only changes.

blog/introduction-to-data-models-in-cloud-datastore/test_blog.py renamed to blog/introduction_to_data_models_in_cloud_datastore/test_blog.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
# See the License for the specific language governing permissions and
1212
# limitations under the License.
1313
#
14-
from blog import main
1514
from tests import CloudBaseTest
1615

16+
from .blog import main
17+
1718

1819
class BlogTestCase(CloudBaseTest):
1920
"""Simple test case that ensures the blog code doesn't throw any errors."""
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright 2015, Google, Inc.
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
#
6+
# http://www.apache.org/licenses/LICENSE-2.0
7+
#
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
#
14+
from tests import CloudBaseTest
15+
16+
from .wiki import main
17+
18+
19+
class WikiTestCase(CloudBaseTest):
20+
"""Simple test case that ensures the wiki code doesn't throw any errors."""
21+
22+
def test_main(self):
23+
main(self.constants['projectId'])

0 commit comments

Comments
 (0)