fix CITE test A.4.4.7 (#200)
* fix CITE test A.4.4.7 * fix CITE test A.4.4.7
This commit is contained in:
+15
-14
@@ -330,20 +330,21 @@ class API(object):
|
||||
|
||||
fcm['collections'].append(collection)
|
||||
|
||||
fcm['links'].append({
|
||||
'type': 'application/json',
|
||||
'rel': 'self',
|
||||
'title': 'This document as JSON',
|
||||
'href': '{}/collections?f=json'.format(
|
||||
self.config['server']['url'])
|
||||
})
|
||||
fcm['links'].append({
|
||||
'type': 'text/html',
|
||||
'rel': 'alternate',
|
||||
'title': 'This document as HTML',
|
||||
'href': '{}/collections?f=html'.format(
|
||||
self.config['server']['url'])
|
||||
})
|
||||
if dataset is None:
|
||||
fcm['links'].append({
|
||||
'type': 'application/json',
|
||||
'rel': 'self',
|
||||
'title': 'This document as JSON',
|
||||
'href': '{}/collections?f=json'.format(
|
||||
self.config['server']['url'])
|
||||
})
|
||||
fcm['links'].append({
|
||||
'type': 'text/html',
|
||||
'rel': 'alternate',
|
||||
'title': 'This document as HTML',
|
||||
'href': '{}/collections?f=html'.format(
|
||||
self.config['server']['url'])
|
||||
})
|
||||
|
||||
if format_ == 'html': # render
|
||||
fcm['links'][0]['rel'] = 'alternate'
|
||||
|
||||
+1
-1
@@ -166,7 +166,7 @@ def test_describe_collections(config, api_):
|
||||
assert collection['name'] == 'obs'
|
||||
assert collection['title'] == 'Observations'
|
||||
assert collection['description'] == 'Observations'
|
||||
assert len(collection['links']) == 8
|
||||
assert len(collection['links']) == 6
|
||||
|
||||
rsp_headers, code, response = api_.describe_collections(
|
||||
req_headers, {'f': 'html'}, 'obs')
|
||||
|
||||
Reference in New Issue
Block a user