-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes namespacing + fix basic tests
Refactor database
- Loading branch information
Showing
16 changed files
with
132 additions
and
70 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 |
---|---|---|
@@ -1,3 +1,9 @@ | ||
"""Top-level package for Flask Torusoft API Core.""" | ||
|
||
from couchapy.couchdb import CouchDB | ||
from couchapy.error import CouchError, InvalidKeysException | ||
from couchapy.session import Session | ||
|
||
__author__ = """Lee Lunn""" | ||
__email__ = 'lee@torusoft.com' | ||
__version__ = '0.0.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
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,31 @@ | ||
import couchapy.decorators as couch | ||
|
||
|
||
class _DatabaseChanges(): | ||
""" | ||
Namespace class for design document related endpoints. | ||
This class is not intended for direct use and should be accessed through the database attribute of a CouchDB instance. | ||
""" | ||
def __init__(self, parent, **kwargs): | ||
# TODO: rename this to reference the host couch instance | ||
self.parent = parent.parent | ||
self._db = parent._db | ||
self._predefined_segments = parent._predefined_segments | ||
|
||
@couch.endpoint('/:db:/_changes', method='post', | ||
data_keys=couch.AllowedKeys.DATABASE__CHANGES__DATA, | ||
query_keys=couch.AllowedKeys.DATABASE__CHANGES__PARAMS) | ||
def get_by_post(self, couch_data, **kwargs): | ||
""" | ||
See https://docs.couchdb.org/en/stable/api/database/bulk-api.html#post--db-_design_docs | ||
""" | ||
return couch_data | ||
|
||
@couch.endpoint('/:db:/_changes', query_keys=couch.AllowedKeys.DATABASE__CHANGES__PARAMS) | ||
def get(self, couch_data, **kwargs): | ||
""" | ||
See https://docs.couchdb.org/en/stable/api/ddoc/common.html#get--db-_design-ddoc | ||
See https://docs.couchdb.org/en/stable/api/document/common.html#get--db-docid | ||
""" | ||
return couch_data |
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,22 @@ | ||
[bumpversion] | ||
current_version = 0.0.2 | ||
commit = True | ||
tag = True | ||
|
||
[bumpversion:file:setup.py] | ||
search = version='{current_version}' | ||
replace = version='{new_version}' | ||
|
||
[bumpversion:file:couchapy/__init__.py] | ||
search = __version__ = '{current_version}' | ||
replace = __version__ = '{new_version}' | ||
|
||
[bdist_wheel] | ||
universal = 1 | ||
|
||
[flake8] | ||
exclude = docs | ||
|
||
[tool:pytest] | ||
collect_ignore = ['setup.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import pytest | ||
|
||
|
||
@pytest.fixture(scope='session') | ||
def httpserver_listen_address(): | ||
return ("127.0.0.1", 8000) |
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
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
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