-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
145 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,8 @@ | |
.ropeproject | ||
|
||
# Eve | ||
run.py | ||
settings.py | ||
/run.py | ||
/settings.py | ||
|
||
# Python | ||
*.py[co] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
examples/foreign_primary_key/app.py → ...chemy/examples/foreign_primary_key/app.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
3 changes: 1 addition & 2 deletions
3
examples/foreign_primary_key/settings.py → .../examples/foreign_primary_key/settings.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
examples/many_to_many/app.py → eve_sqlalchemy/examples/many_to_many/app.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
3 changes: 1 addition & 2 deletions
3
examples/many_to_many/settings.py → ...alchemy/examples/many_to_many/settings.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
examples/many_to_one/app.py → eve_sqlalchemy/examples/many_to_one/app.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
examples/many_to_one/settings.py → ...lalchemy/examples/many_to_one/settings.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
4 changes: 2 additions & 2 deletions
4
examples/one_to_many/app.py → eve_sqlalchemy/examples/one_to_many/app.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
examples/one_to_many/settings.py → ...lalchemy/examples/one_to_many/settings.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
3 changes: 1 addition & 2 deletions
3
examples/simple/settings.py → eve_sqlalchemy/examples/simple/settings.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Empty file.
7 changes: 4 additions & 3 deletions
7
examples/trivial/trivial.py → eve_sqlalchemy/examples/trivial/trivial.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
|
||
from eve_sqlalchemy.examples.many_to_many import settings | ||
from eve_sqlalchemy.examples.many_to_many.domain import Base | ||
from eve_sqlalchemy.tests import TestMinimal | ||
|
||
SETTINGS = vars(settings) | ||
|
||
|
||
class TestManyToMany(TestMinimal): | ||
|
||
def setUp(self, url_converters=None): | ||
super(TestManyToMany, self).setUp(SETTINGS, url_converters, Base) | ||
|
||
def bulk_insert(self): | ||
self.app.data.insert('children', [{'id': k} for k in range(1, 5)]) | ||
self.app.data.insert('parents', [ | ||
{'id': 1, 'children': [1, 2]}, | ||
{'id': 2, 'children': [1, 3]}, | ||
{'id': 3, 'children': []}]) | ||
|
||
def test_get_related_children_with_where(self): | ||
response, status = self.get('children', '?where={"parents": 1}') | ||
self.assert200(status) | ||
children = response['_items'] | ||
self.assertEqual([c['id'] for c in children], [1, 2]) | ||
|
||
def test_get_related_parents_with_where(self): | ||
response, status = self.get('parents', '?where={"children": 1}') | ||
self.assert200(status) | ||
parents = response['_items'] | ||
self.assertEqual([p['id'] for p in parents], [1, 2]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
|
||
from eve_sqlalchemy.examples.many_to_one import settings | ||
from eve_sqlalchemy.examples.many_to_one.domain import Base | ||
from eve_sqlalchemy.tests import TestMinimal | ||
|
||
SETTINGS = vars(settings) | ||
|
||
|
||
class TestManyToOne(TestMinimal): | ||
|
||
def setUp(self, url_converters=None): | ||
super(TestManyToOne, self).setUp(SETTINGS, url_converters, Base) | ||
|
||
def bulk_insert(self): | ||
self.app.data.insert('children', [{'id': k} for k in range(1, 5)]) | ||
self.app.data.insert('parents', [ | ||
{'id': 1, 'child': 1}, | ||
{'id': 2, 'child': 1}, | ||
{'id': 3}]) | ||
|
||
def test_get_related_children_with_where(self): | ||
response, status = self.get('children', '?where={"parents": 1}') | ||
self.assert200(status) | ||
children = response['_items'] | ||
self.assertEqual([c['id'] for c in children], [1]) | ||
|
||
def test_get_related_parents_with_where(self): | ||
response, status = self.get('parents', '?where={"child": 1}') | ||
self.assert200(status) | ||
parents = response['_items'] | ||
self.assertEqual([p['id'] for p in parents], [1, 2]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
|
||
from eve_sqlalchemy.examples.one_to_many import settings | ||
from eve_sqlalchemy.examples.one_to_many.domain import Base | ||
from eve_sqlalchemy.tests import TestMinimal | ||
|
||
SETTINGS = vars(settings) | ||
|
||
|
||
class TestOneToMany(TestMinimal): | ||
|
||
def setUp(self, url_converters=None): | ||
super(TestOneToMany, self).setUp(SETTINGS, url_converters, Base) | ||
|
||
def bulk_insert(self): | ||
self.app.data.insert('children', [{'id': k} for k in range(1, 5)]) | ||
self.app.data.insert('parents', [ | ||
{'id': 1, 'children': [1, 2]}, | ||
{'id': 2, 'children': []}, | ||
{'id': 3, 'children': [4]}]) | ||
|
||
def test_get_related_children_with_where(self): | ||
response, status = self.get('children', '?where={"parent": 1}') | ||
self.assert200(status) | ||
children = response['_items'] | ||
self.assertEqual([c['id'] for c in children], [1, 2]) | ||
|
||
def test_get_related_parents_with_where(self): | ||
response, status = self.get('parents', '?where={"children": 2}') | ||
self.assert200(status) | ||
parents = response['_items'] | ||
self.assertEqual([p['id'] for p in parents], [1]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters