Notes, TODOs and formating

This commit is contained in:
tim 2016-11-15 11:40:41 +01:00 committed by Sylvain Bellemare
parent 8e8bc90742
commit 09cbba8886
3 changed files with 9 additions and 6 deletions

View File

@ -17,6 +17,7 @@ from bigchaindb.web.views.transactions import transaction_views
from bigchaindb.monitor import Monitor from bigchaindb.monitor import Monitor
# TODO: Figure out if we do we need all this boilerplate.
class StandaloneApplication(gunicorn.app.base.BaseApplication): class StandaloneApplication(gunicorn.app.base.BaseApplication):
"""Run a **wsgi** app wrapping it in a Gunicorn Base Application. """Run a **wsgi** app wrapping it in a Gunicorn Base Application.

View File

@ -1,7 +1,8 @@
"""This module provides the blueprint for some basic API endpoints. """This module provides the blueprint for some basic API endpoints.
For more information please refer to the documentation on ReadTheDocs: For more information please refer to the documentation on ReadTheDocs:
- https://docs.bigchaindb.com/projects/server/en/latest/drivers-clients/http-client-server-api.html - https://docs.bigchaindb.com/projects/server/en/latest/drivers-clients/
http-client-server-api.html
""" """
from flask import current_app, request, Blueprint from flask import current_app, request, Blueprint
from flask_restful import Resource, Api from flask_restful import Resource, Api
@ -28,6 +29,7 @@ transaction_views = Blueprint('transaction_views', __name__)
transaction_api = Api(transaction_views) transaction_api = Api(transaction_views)
# TODO: Do we really need this?
# Unfortunately I cannot find a reference to this decorator. # Unfortunately I cannot find a reference to this decorator.
# This answer on SO is quite useful tho: # This answer on SO is quite useful tho:
# - http://stackoverflow.com/a/13432373/597097 # - http://stackoverflow.com/a/13432373/597097
@ -78,8 +80,8 @@ class TransactionStatusApi(Resource):
tx_id (str): the id of the transaction. tx_id (str): the id of the transaction.
Return: Return:
A ``dict`` in the format ``{'status': <status>}``, where ``<status>`` A ``dict`` in the format ``{'status': <status>}``, where
is one of "valid", "invalid", "undecided", "backlog". ``<status>`` is one of "valid", "invalid", "undecided", "backlog".
""" """
pool = current_app.config['bigchain_pool'] pool = current_app.config['bigchain_pool']
@ -103,8 +105,8 @@ class TransactionListApi(Resource):
pool = current_app.config['bigchain_pool'] pool = current_app.config['bigchain_pool']
monitor = current_app.config['monitor'] monitor = current_app.config['monitor']
# `force` will try to format the body of the POST request even if the `content-type` header is not # `force` will try to format the body of the POST request even if the
# set to `application/json` # `content-type` header is not set to `application/json`
tx = request.get_json(force=True) tx = request.get_json(force=True)
try: try:

View File

@ -1,4 +1,4 @@
def test_settings(monkeypatch): def test_settings():
import bigchaindb import bigchaindb
from bigchaindb.web import server from bigchaindb.web import server