Skip to content

Commit 3e75675

Browse files
committed
update tests
1 parent 7b38fb4 commit 3e75675

28 files changed

Lines changed: 112 additions & 44 deletions

pycsw/ogc/api/records.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,9 +1180,9 @@ def federated_catalogues(self, headers_, args, collection):
11801180
fedcats = []
11811181

11821182
if collection == 'metadata:main':
1183-
if 'federatedcatalogues' in self.config:
1184-
LOGGER.debug('Adding federated catalogue {fc}')
1185-
fedcats = self.config.get('federatedcatalogues')
1183+
for fedcat_ in self.config.get('federatedcatalogues', []):
1184+
if fedcat_ == 'OARec':
1185+
fedcats.append(fedcat_)
11861186

11871187
if headers_['Content-Type'] == 'text/html':
11881188
response['title'] = self.config['metadata']['identification']['title']
@@ -1215,7 +1215,7 @@ def federated_catalogue(self, headers_, args, collection, catalogue):
12151215
if collection == 'metadata:main':
12161216
fedcats = self.config.get('federatedcatalogues')
12171217
for fedcat_ in fedcats:
1218-
if fedcat_['id'] == catalogue:
1218+
if fedcat_['id'] == catalogue and fedcat_['type'] == 'OARec':
12191219
fedcat = fedcat_
12201220
break
12211221

pycsw/server.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,8 @@ def dispatch(self, writer=sys.stdout, write_headers=True):
330330

331331
for fedcat in self.config['federatedcatalogues']:
332332
LOGGER.debug('federated catalogue: %s', fedcat)
333-
constraints['FederatedCatalogues']['values'].append(fedcat['url'])
333+
if fedcat['type'] == 'CSW':
334+
constraints['FederatedCatalogues']['values'].append(fedcat['url'])
334335

335336
for key, value in self.outputschemas.items():
336337
get_records_params = ops['GetRecords']['parameters']
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{% extends "_base.html" %}
2+
{% block title %}{{ super() }} Federated catalog {% endblock %}
3+
4+
{% block crumbs %}
5+
{{ super() }} /
6+
<a href="{{ config['server']['url'] }}/collections">Collections</a> /
7+
<a href="{{ config['server']['url'] }}/collections/{{ data['collection'] }}">{{ data['title'] }}</a> /
8+
<a href="{{ config['server']['url'] }}/collections/{{ data['collection'] }}/federatedCatalogs">Federated catalogs</a> /
9+
<a href="{{ config['server']['url'] }}/collections/{{ data['collection'] }}/federatedCatalogs/{{ data['fedcat']['id'] }}">{{ data['fedcat']['title'] }}</a>
10+
{% endblock %}
11+
12+
{% block body %}
13+
14+
<section id="federatedcatalogue">
15+
<h2>Federated catalog</h2>
16+
<h2>{{ data['title'] }}</h2>
17+
18+
<table class="table table-striped table-hover">
19+
<thead>
20+
<tr>
21+
<th>Id</th>
22+
<th>Type</th>
23+
<th>Title</th>
24+
<th>URL</th>
25+
</tr>
26+
</thead>
27+
<tbody>
28+
<tr>
29+
<td>{{ data['fedcat']['id'] }}</td>
30+
<td>{{ data['fedcat']['type'] }}</td>
31+
<td>{{ data['fedcat']['title'] }}</td>
32+
<td><a title="{{ data['fedcat']['title'] }}" href="{{ data['fedcat']['url'] }}">{{ data['fedcat']['url'] }}</a></td>
33+
</tr>
34+
</tbody>
35+
</table>
36+
</section>
37+
38+
{% endblock %}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{% extends "_base.html" %}
2+
{% block title %}{{ super() }} Federated catalogs {% endblock %}
3+
4+
{% block crumbs %}
5+
{{ super() }} /
6+
<a href="{{ config['server']['url'] }}/collections">Collections</a> /
7+
<a href="{{ config['server']['url'] }}/collections/{{ data['collection'] }}">{{ data['title'] }}</a> /
8+
<a href="{{ config['server']['url'] }}/collections/{{ data['collection'] }}/federatedCatalogs">Federated catalogs</a>
9+
{% endblock %}
10+
11+
{% block body %}
12+
13+
<section id="federatedcatalogues">
14+
<h2>Federated catalogs</h2>
15+
<h2>{{ data['title'] }}</h2>
16+
17+
<table class="table table-striped table-hover">
18+
<thead>
19+
<tr>
20+
<th>Id</th>
21+
<th>Type</th>
22+
<th>Title</th>
23+
</tr>
24+
</thead>
25+
<tbody>
26+
{% for fc in data['fedcats'] %}
27+
<tr>
28+
<td><a title="{{ fc['title'] }}" href="{{ config['server']['url'] }}/collections/{{ data['collection'] }}/federatedCatalogs/{{ fc['id'] }}">{{ fc['id'] }}</a></td>
29+
<td>{{ fc['type'] }}</td>
30+
<td>{{ fc['title'] }}</td>
31+
</tr>
32+
{% endfor %}
33+
</tbody>
34+
</table>
35+
</section>
36+
37+
{% endblock %}

tests/functionaltests/suites/apiso-inspire/expected/get_GetCapabilities-lang.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@
260260
<ows:Value>3.0.0</ows:Value>
261261
</ows:Parameter>
262262
<ows:Constraint name="FederatedCatalogues">
263-
<ows:Value>http://geo.data.gov/geoportal/csw/discovery</ows:Value>
263+
<ows:Value>https://catalogue.arctic-sdi.org/csw</ows:Value>
264264
</ows:Constraint>
265265
<ows:Constraint name="MaxRecordDefault">
266266
<ows:Value>10</ows:Value>

tests/functionaltests/suites/apiso-inspire/expected/get_GetCapabilities.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@
260260
<ows:Value>3.0.0</ows:Value>
261261
</ows:Parameter>
262262
<ows:Constraint name="FederatedCatalogues">
263-
<ows:Value>http://geo.data.gov/geoportal/csw/discovery</ows:Value>
263+
<ows:Value>https://catalogue.arctic-sdi.org/csw</ows:Value>
264264
</ows:Constraint>
265265
<ows:Constraint name="MaxRecordDefault">
266266
<ows:Value>10</ows:Value>

tests/functionaltests/suites/apiso/expected/post_GetCapabilities.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@
260260
<ows:Value>3.0.0</ows:Value>
261261
</ows:Parameter>
262262
<ows:Constraint name="FederatedCatalogues">
263-
<ows:Value>http://geo.data.gov/geoportal/csw/discovery</ows:Value>
263+
<ows:Value>https://catalogue.arctic-sdi.org/csw</ows:Value>
264264
</ows:Constraint>
265265
<ows:Constraint name="MaxRecordDefault">
266266
<ows:Value>10</ows:Value>

tests/functionaltests/suites/atom/expected/post_GetCapabilities.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@
197197
<ows:Value>3.0.0</ows:Value>
198198
</ows:Parameter>
199199
<ows:Constraint name="FederatedCatalogues">
200-
<ows:Value>http://geo.data.gov/geoportal/csw/discovery</ows:Value>
200+
<ows:Value>https://catalogue.arctic-sdi.org/csw</ows:Value>
201201
</ows:Constraint>
202202
<ows:Constraint name="MaxRecordDefault">
203203
<ows:Value>10</ows:Value>

tests/functionaltests/suites/cite/expected/get_27e17158-c57a-4493-92ac-dba8934cf462.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@
246246
<ows:Value>3.0.0</ows:Value>
247247
</ows:Parameter>
248248
<ows:Constraint name="FederatedCatalogues">
249-
<ows:Value>http://geo.data.gov/geoportal/csw/discovery</ows:Value>
249+
<ows:Value>https://catalogue.arctic-sdi.org/csw</ows:Value>
250250
</ows:Constraint>
251251
<ows:Constraint name="MaxRecordDefault">
252252
<ows:Value>10</ows:Value>

tests/functionaltests/suites/cite/expected/get_2ab7d1fa-885b-459f-80e4-b6282eab4f8c.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@
246246
<ows:Value>3.0.0</ows:Value>
247247
</ows:Parameter>
248248
<ows:Constraint name="FederatedCatalogues">
249-
<ows:Value>http://geo.data.gov/geoportal/csw/discovery</ows:Value>
249+
<ows:Value>https://catalogue.arctic-sdi.org/csw</ows:Value>
250250
</ows:Constraint>
251251
<ows:Constraint name="MaxRecordDefault">
252252
<ows:Value>10</ows:Value>

0 commit comments

Comments
 (0)