mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Fixed the docs URL in HTTP API responses
This commit is contained in:
parent
6aac745225
commit
f2a05c9e3b
@ -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 {
|
||||
|
@ -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 == {
|
||||
|
Loading…
x
Reference in New Issue
Block a user