Skip to content

Commit

Permalink
Eve 0.7 support
Browse files Browse the repository at this point in the history
The necessary premise is that I have (very) limited knowledge of
eve-sqlalchemy codebase. These changes might not be sufficient for
a Eve 0.7 compatible release of the eve-sqlalchemy extension.

I wanted to see what was preventing eve-sqlalchemy from running on Eve
0.7. As it turns out, there are no major obstacles. With this commit
all tests are passing with Eve<0.8, locally at least.

Next up would probably be a careful review of Eve 0.7 changelog, to see
what new features (or fixes) need to be specifically addressed here.
  • Loading branch information
nicolaiarocci authored and dkellner committed Oct 4, 2018
1 parent b7de86a commit ab73e68
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Changelog
0.7.0 (unreleased)
~~~~~~~~~~~~~~~~~~

- Nothing changed yet.
- Eve 0.7 support (#178) [Nicola Iarocci]


0.6.0 (2018-08-15)
Expand Down
16 changes: 16 additions & 0 deletions eve_sqlalchemy/tests/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@

class TestGet(eve_get_tests.TestGet, TestBase):

@pytest.mark.xfail(True, run=False, reason='not applicable to SQLAlchemy')
def test_get_aggregation_parsing(self):
pass

@pytest.mark.xfail(True, run=False, reason='not applicable to SQLAlchemy')
def test_get_aggregation_pagination(self):
pass

@pytest.mark.xfail(True, run=False, reason='not applicable to SQLAlchemy')
def test_get_aggregation_endpoint(self):
pass

@pytest.mark.xfail(True, run=False, reason='not applicable to SQLAlchemy')
def test_get_where_mongo_combined_date(self):
pass
Expand Down Expand Up @@ -60,6 +72,10 @@ def test_get_where_allowed_filters(self):
def test_get_embedded_media(self):
pass

@pytest.mark.xfail(True, run=False, reason='not implemented yet')
def test_get_embedded_media_validate_rest_of_fields(self):
pass

def test_get_embedded(self):
# Eve test uses the Mongo layer directly.
# TODO: Fix directly in Eve and remove this override
Expand Down
16 changes: 16 additions & 0 deletions eve_sqlalchemy/tests/post.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,22 @@

class TestPost(eve_post_tests.TestPost, TestBase):

@pytest.mark.xfail(True, run=False, reason='not applicable to SQLAlchemy')
def test_post_auto_create_lists(self):
pass

@pytest.mark.xfail(True, run=False, reason='not applicable to SQLAlchemy')
def test_post_auto_collapse_multiple_keys(self):
pass

@pytest.mark.xfail(True, run=False, reason='not applicable to SQLAlchemy')
def test_post_auto_collapse_media_list(self):
pass

@pytest.mark.xfail(True, run=False, reason='not applicable to SQLAlchemy')
def test_dbref_post_referential_integrity(self):
pass

@pytest.mark.xfail(True, run=False, reason='not implemented yet')
def test_post_duplicate_key(self):
"""POSTing an already existing key should result in 409, not 422.
Expand Down
7 changes: 6 additions & 1 deletion eve_sqlalchemy/tests/put.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@

class TestPut(eve_put_tests.TestPut, TestBase):

@pytest.mark.xfail(True, run=False, reason='not applicable to SQLAlchemy')
def test_put_dbref_subresource(self):
pass

@pytest.mark.xfail(True, run=False, reason='not applicable to SQLAlchemy')
def test_allow_unknown(self):
pass
Expand Down Expand Up @@ -157,7 +161,8 @@ def compare_put_with_get(self, fields, put_response):
raw_r = self.test_client.get(self.item_id_url)
r, status = self.parse_response(raw_r)
self.assert200(status)
self.assertEqual(raw_r.headers.get('ETag'),
# Since v0.7, ETag conform to RFC 7232-2.3 (see Eve#794)
self.assertEqual(raw_r.headers.get('ETag')[1:-1],
put_response[ETAG])
if isinstance(fields, six.string_types):
return r[fields]
Expand Down
4 changes: 1 addition & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,9 @@ def read(*parts):
packages=find_packages(),
test_suite='eve_sqlalchemy.tests',
install_requires=[
'Eve>=0.6,<0.7',
'Eve<0.8',
'Flask-SQLAlchemy>=1.0,<2.999',
'SQLAlchemy>=1.1',
# keep until pip properly resolves dependencies:
'Flask<0.11',
],
tests_require=test_dependencies,
extras_require={
Expand Down

0 comments on commit ab73e68

Please sign in to comment.