From 3bc0f5f8ebc8eb4e9d91fa8b77d926b0712f59c4 Mon Sep 17 00:00:00 2001 From: Syrus Akbary Date: Tue, 27 Oct 2015 23:56:24 -0700 Subject: [PATCH] Moved all the examples from tests to examples --- .gitignore | 2 ++ README.md | 4 ++-- {tests/starwars => examples}/__init__.py | 0 {tests/starwars_django => examples/starwars}/__init__.py | 0 {tests => examples}/starwars/data.py | 0 {tests => examples}/starwars/schema.py | 0 .../starwars_relay => examples/starwars/tests}/__init__.py | 0 {tests/starwars => examples/starwars/tests}/test_query.py | 4 ++-- examples/starwars_django/__init__.py | 0 {tests => examples}/starwars_django/data.py | 0 {tests => examples}/starwars_django/models.py | 0 {tests => examples}/starwars_django/schema.py | 0 examples/starwars_django/tests/__init__.py | 0 .../starwars_django/tests}/test_connections.py | 6 +++--- .../starwars_django/tests}/test_objectidentification.py | 4 ++-- examples/starwars_relay/__init__.py | 0 {tests => examples}/starwars_relay/data.py | 0 {tests => examples}/starwars_relay/schema.py | 0 examples/starwars_relay/tests/__init__.py | 0 .../starwars_relay/tests}/test_connections.py | 4 ++-- .../starwars_relay/tests}/test_objectidentification.py | 4 ++-- tests/django_settings.py | 2 +- 22 files changed, 16 insertions(+), 14 deletions(-) rename {tests/starwars => examples}/__init__.py (100%) rename {tests/starwars_django => examples/starwars}/__init__.py (100%) rename {tests => examples}/starwars/data.py (100%) rename {tests => examples}/starwars/schema.py (100%) rename {tests/starwars_relay => examples/starwars/tests}/__init__.py (100%) rename {tests/starwars => examples/starwars/tests}/test_query.py (99%) create mode 100644 examples/starwars_django/__init__.py rename {tests => examples}/starwars_django/data.py (100%) rename {tests => examples}/starwars_django/models.py (100%) rename {tests => examples}/starwars_django/schema.py (100%) create mode 100644 examples/starwars_django/tests/__init__.py rename {tests/starwars_django => examples/starwars_django/tests}/test_connections.py (91%) rename {tests/starwars_django => examples/starwars_django/tests}/test_objectidentification.py (97%) create mode 100644 examples/starwars_relay/__init__.py rename {tests => examples}/starwars_relay/data.py (100%) rename {tests => examples}/starwars_relay/schema.py (100%) create mode 100644 examples/starwars_relay/tests/__init__.py rename {tests/starwars_relay => examples/starwars_relay/tests}/test_connections.py (93%) rename {tests/starwars_relay => examples/starwars_relay/tests}/test_objectidentification.py (97%) diff --git a/.gitignore b/.gitignore index 37744dec..57bee153 100644 --- a/.gitignore +++ b/.gitignore @@ -59,3 +59,5 @@ docs/_build/ # PyBuilder target/ + +/tests/django.sqlite diff --git a/README.md b/README.md index 1376c733..8ac98e84 100644 --- a/README.md +++ b/README.md @@ -49,8 +49,8 @@ result = schema.execute(query) If you want to learn even more, you can also check the following examples: -* Relay Schema: [Starwars Relay example](tests/starwars_relay) -* Django: [Starwars Django example](tests/starwars_django) +* Relay Schema: [Starwars Relay example](examples/starwars_relay) +* Django: [Starwars Django example](examples/starwars_django) ## Contributing diff --git a/tests/starwars/__init__.py b/examples/__init__.py similarity index 100% rename from tests/starwars/__init__.py rename to examples/__init__.py diff --git a/tests/starwars_django/__init__.py b/examples/starwars/__init__.py similarity index 100% rename from tests/starwars_django/__init__.py rename to examples/starwars/__init__.py diff --git a/tests/starwars/data.py b/examples/starwars/data.py similarity index 100% rename from tests/starwars/data.py rename to examples/starwars/data.py diff --git a/tests/starwars/schema.py b/examples/starwars/schema.py similarity index 100% rename from tests/starwars/schema.py rename to examples/starwars/schema.py diff --git a/tests/starwars_relay/__init__.py b/examples/starwars/tests/__init__.py similarity index 100% rename from tests/starwars_relay/__init__.py rename to examples/starwars/tests/__init__.py diff --git a/tests/starwars/test_query.py b/examples/starwars/tests/test_query.py similarity index 99% rename from tests/starwars/test_query.py rename to examples/starwars/tests/test_query.py index c0d94357..5c5939e5 100644 --- a/tests/starwars/test_query.py +++ b/examples/starwars/tests/test_query.py @@ -1,6 +1,6 @@ -from .schema import Schema, Query +from ..schema import Schema, Query from graphql.core import graphql -from .data import setup +from ..data import setup setup() diff --git a/examples/starwars_django/__init__.py b/examples/starwars_django/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/starwars_django/data.py b/examples/starwars_django/data.py similarity index 100% rename from tests/starwars_django/data.py rename to examples/starwars_django/data.py diff --git a/tests/starwars_django/models.py b/examples/starwars_django/models.py similarity index 100% rename from tests/starwars_django/models.py rename to examples/starwars_django/models.py diff --git a/tests/starwars_django/schema.py b/examples/starwars_django/schema.py similarity index 100% rename from tests/starwars_django/schema.py rename to examples/starwars_django/schema.py diff --git a/examples/starwars_django/tests/__init__.py b/examples/starwars_django/tests/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/starwars_django/test_connections.py b/examples/starwars_django/tests/test_connections.py similarity index 91% rename from tests/starwars_django/test_connections.py rename to examples/starwars_django/tests/test_connections.py index 9992f0f3..64981752 100644 --- a/tests/starwars_django/test_connections.py +++ b/examples/starwars_django/tests/test_connections.py @@ -1,9 +1,9 @@ import pytest from graphql.core import graphql -from .models import * -from .schema import schema -from .data import initialize +from ..models import * +from ..schema import schema +from ..data import initialize pytestmark = pytest.mark.django_db diff --git a/tests/starwars_django/test_objectidentification.py b/examples/starwars_django/tests/test_objectidentification.py similarity index 97% rename from tests/starwars_django/test_objectidentification.py rename to examples/starwars_django/tests/test_objectidentification.py index 84fb5413..4e0cd84d 100644 --- a/tests/starwars_django/test_objectidentification.py +++ b/examples/starwars_django/tests/test_objectidentification.py @@ -1,9 +1,9 @@ import pytest from pytest import raises from graphql.core import graphql -from .data import initialize +from ..data import initialize -from .schema import schema +from ..schema import schema pytestmark = pytest.mark.django_db diff --git a/examples/starwars_relay/__init__.py b/examples/starwars_relay/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/starwars_relay/data.py b/examples/starwars_relay/data.py similarity index 100% rename from tests/starwars_relay/data.py rename to examples/starwars_relay/data.py diff --git a/tests/starwars_relay/schema.py b/examples/starwars_relay/schema.py similarity index 100% rename from tests/starwars_relay/schema.py rename to examples/starwars_relay/schema.py diff --git a/examples/starwars_relay/tests/__init__.py b/examples/starwars_relay/tests/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/starwars_relay/test_connections.py b/examples/starwars_relay/tests/test_connections.py similarity index 93% rename from tests/starwars_relay/test_connections.py rename to examples/starwars_relay/tests/test_connections.py index ad635e84..72910940 100644 --- a/tests/starwars_relay/test_connections.py +++ b/examples/starwars_relay/tests/test_connections.py @@ -1,5 +1,5 @@ -from .schema import schema -from .data import setup +from ..schema import schema +from ..data import setup setup() diff --git a/tests/starwars_relay/test_objectidentification.py b/examples/starwars_relay/tests/test_objectidentification.py similarity index 97% rename from tests/starwars_relay/test_objectidentification.py rename to examples/starwars_relay/tests/test_objectidentification.py index b6331455..913fdc42 100644 --- a/tests/starwars_relay/test_objectidentification.py +++ b/examples/starwars_relay/tests/test_objectidentification.py @@ -1,5 +1,5 @@ -from .schema import schema -from .data import setup +from ..schema import schema +from ..data import setup setup() diff --git a/tests/django_settings.py b/tests/django_settings.py index f9c41629..4614caae 100644 --- a/tests/django_settings.py +++ b/tests/django_settings.py @@ -2,7 +2,7 @@ SECRET_KEY = 1 INSTALLED_APPS = [ 'graphene.contrib.django', - 'tests.starwars_django', + 'examples.starwars_django', 'tests.contrib_django', ]