Skip to content

Commit

Permalink
Added tox config with flake8 and nosetests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Takashi Matsuo committed May 8, 2015
1 parent e6bd547 commit 19e88dd
Show file tree
Hide file tree
Showing 32 changed files with 248 additions and 428 deletions.
7 changes: 7 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[run]
include =
datastore/*
localtesting/*
[report]
exclude_lines =
pragma: NO COVER
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

*.pyc
.coverage
.tox
coverage.xml
nosetests.xml
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cache:
directories:
- $HOME/gcloud/
env:
- PATH=$PATH:$HOME/gcloud/google-cloud-sdk/bin GOOGLE_APPLICATION_CREDENTIALS=$TRAVIS_BUILD_DIR/client_secrets.json #Other environment variables on same line
- PATH=$PATH:$HOME/gcloud/google-cloud-sdk/bin GOOGLE_APPLICATION_CREDENTIALS=$TRAVIS_BUILD_DIR/client_secrets.json PYTHONPATH=${HOME}/gcloud/platform/google_appengine #Other environment variables on same line

before_install:
#ENCRYPT YOUR PRIVATE KEY (If you need authentication)
Expand Down Expand Up @@ -33,7 +33,7 @@ before_install:
fi

install:
#Add app specific setup here
- pip install tox

script:
#Test and/or deploy your app with gcloud commands here!
- tox
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,26 @@ For more detailed introduction to a product, check the README in the correspondi

* See [CONTRIBUTING.md](CONTRIBUTING.md)

### How to run the test

To run the tests, please install App Engine Python SDK and tox and run
tox with the environment variable PYTHONPATH to the App Engine Python
SDK.

You can install App Engine Python SDK with
[Google Cloud SDK](https://cloud.google.com/sdk/) with the following
command:

$ gcloud components update gae-python

Here is instructions to run the tests with virtualenv, $GCLOUD is your
Google Cloud SDK installation path.

$ virtualenv -p python2.7 --no-site-packages /some/where
$ source /some/where/bin/activate
$ pip install tox
$ env PYTHONPATH=${GCLOUD}/platform/google_appengine tox

## Licensing

* See [LICENSE](LICENSE)
2 changes: 1 addition & 1 deletion datastore/ndb/app.yaml → app.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# dummy app.yaml for nosegae

application: ndb-snippets
application: python-docs-samples
version: 1
api_version: 1
runtime: python27
Expand Down
Empty file added datastore/__init__.py
Empty file.
35 changes: 0 additions & 35 deletions datastore/ndb/CONTRIBUTING.md

This file was deleted.

202 changes: 0 additions & 202 deletions datastore/ndb/LICENSE

This file was deleted.

17 changes: 0 additions & 17 deletions datastore/ndb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,3 @@ appengine-ndb-snippets

Sample code snippets for NDB.

How to run the test
===================

To run the tests, please install App Engine Python SDK and tox and run
tox with the environment variable PYTHONPATH to the App Engine Python SDK.

You can install App Engine Python SDK with [Google Cloud SDK](https://cloud.google.com/sdk/) with the following command:

$ gcloud components update gae-python

Here is instructions to run the tests with virtualenv, $GCLOUD is your
Google Cloud SDK installation path.

$ virtualenv -p python2.7 --no-site-packages .
$ source bin/activate
$ pip install tox
$ env PYTHONPATH=${GCLOUD}/platform/google_appengine tox
Empty file added datastore/ndb/__init__.py
Empty file.
Empty file.
Empty file.
2 changes: 1 addition & 1 deletion datastore/ndb/modeling/tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

import unittest

from google.appengine.ext import testbed
from google.appengine.datastore import datastore_stub_util
from google.appengine.ext import testbed


class TestCase(unittest.TestCase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@

from google.appengine.ext import ndb

import contact_with_group_models as models
import test_base

from .. import contact_with_group_models as models


class ContactTestCase(test_base.TestCase):
"""A test case for the Contact model with groups."""
Expand Down
3 changes: 2 additions & 1 deletion datastore/ndb/modeling/tests/test_keyproperty_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@

import unittest

import keyproperty_models as models
import test_base

from .. import keyproperty_models as models


class ContactTestCase(test_base.TestCase):
"""A test case for the Contact model class with KeyProperty."""
Expand Down
3 changes: 2 additions & 1 deletion datastore/ndb/modeling/tests/test_naive_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@

import unittest

import naive_models as models
import test_base

from .. import naive_models as models


class ContactTestCase(test_base.TestCase):
"""A test case for the naive Contact model classe."""
Expand Down
5 changes: 3 additions & 2 deletions datastore/ndb/modeling/tests/test_parent_child_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@

import unittest

import parent_child_models as models
from google.appengine.ext import ndb

import test_base

from google.appengine.ext import ndb
from .. import parent_child_models as models


class ContactTestCase(test_base.TestCase):
Expand Down
Loading

0 comments on commit 19e88dd

Please sign in to comment.