Merge pull request #1178 from bigchaindb/bug/1173/fix-docs-url-in-http-api-responses

Fixed the docs URL in HTTP API responses
This commit is contained in:
Troy McConaghy 2017-02-09 14:48:57 +01:00 committed by GitHub
commit fe539ee19f
2 changed files with 7 additions and 7 deletions

View File

@ -11,8 +11,8 @@ from bigchaindb import version
class RootIndex(Resource):
def get(self):
docs_url = [
'https://docs.bigchaindb.com/projects/server/en/',
version.__short_version__ + '/'
'https://docs.bigchaindb.com/projects/server/en/v',
version.__version__ + '/'
]
api_v1_url = base_url() + 'api/v1/'
return flask.jsonify({
@ -31,8 +31,8 @@ class ApiV1Index(Resource):
def get(self):
api_root = base_url() + 'api/v1/'
docs_url = [
'https://docs.bigchaindb.com/projects/server/en/',
version.__short_version__,
'https://docs.bigchaindb.com/projects/server/en/v',
version.__version__,
'/drivers-clients/http-client-server-api.html',
]
return {

View File

@ -8,7 +8,7 @@ def test_api_root_endpoint(client):
res = client.get('/')
assert res.json == {
'_links': {
'docs': 'https://docs.bigchaindb.com/projects/server/en/tst/',
'docs': 'https://docs.bigchaindb.com/projects/server/en/vtsttst/',
'api_v1': 'http://localhost/api/v1/',
},
'version': 'tsttst',
@ -19,10 +19,10 @@ def test_api_root_endpoint(client):
@mock.patch('bigchaindb.version.__short_version__', 'tst')
@mock.patch('bigchaindb.version.__version__', 'tsttst')
def test_api_v1_endpoint(client):
res = client.get('/api/v1')
docs_url = ['https://docs.bigchaindb.com/projects/server/en/',
'tst',
docs_url = ['https://docs.bigchaindb.com/projects/server/en/vtsttst',
'/drivers-clients/http-client-server-api.html',
]
assert res.json == {