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): 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 {

View File

@ -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 == {