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):
|
class RootIndex(Resource):
|
||||||
def get(self):
|
def get(self):
|
||||||
docs_url = [
|
docs_url = [
|
||||||
'https://docs.bigchaindb.com/projects/server/en/',
|
'https://docs.bigchaindb.com/projects/server/en/v',
|
||||||
version.__short_version__ + '/'
|
version.__version__ + '/'
|
||||||
]
|
]
|
||||||
api_v1_url = base_url() + 'api/v1/'
|
api_v1_url = base_url() + 'api/v1/'
|
||||||
return flask.jsonify({
|
return flask.jsonify({
|
||||||
@ -31,8 +31,8 @@ class ApiV1Index(Resource):
|
|||||||
def get(self):
|
def get(self):
|
||||||
api_root = base_url() + 'api/v1/'
|
api_root = base_url() + 'api/v1/'
|
||||||
docs_url = [
|
docs_url = [
|
||||||
'https://docs.bigchaindb.com/projects/server/en/',
|
'https://docs.bigchaindb.com/projects/server/en/v',
|
||||||
version.__short_version__,
|
version.__version__,
|
||||||
'/drivers-clients/http-client-server-api.html',
|
'/drivers-clients/http-client-server-api.html',
|
||||||
]
|
]
|
||||||
return {
|
return {
|
||||||
|
@ -8,7 +8,7 @@ def test_api_root_endpoint(client):
|
|||||||
res = client.get('/')
|
res = client.get('/')
|
||||||
assert res.json == {
|
assert res.json == {
|
||||||
'_links': {
|
'_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/',
|
'api_v1': 'http://localhost/api/v1/',
|
||||||
},
|
},
|
||||||
'version': 'tsttst',
|
'version': 'tsttst',
|
||||||
@ -19,10 +19,10 @@ def test_api_root_endpoint(client):
|
|||||||
|
|
||||||
|
|
||||||
@mock.patch('bigchaindb.version.__short_version__', 'tst')
|
@mock.patch('bigchaindb.version.__short_version__', 'tst')
|
||||||
|
@mock.patch('bigchaindb.version.__version__', 'tsttst')
|
||||||
def test_api_v1_endpoint(client):
|
def test_api_v1_endpoint(client):
|
||||||
res = client.get('/api/v1')
|
res = client.get('/api/v1')
|
||||||
docs_url = ['https://docs.bigchaindb.com/projects/server/en/',
|
docs_url = ['https://docs.bigchaindb.com/projects/server/en/vtsttst',
|
||||||
'tst',
|
|
||||||
'/drivers-clients/http-client-server-api.html',
|
'/drivers-clients/http-client-server-api.html',
|
||||||
]
|
]
|
||||||
assert res.json == {
|
assert res.json == {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user