• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

rero / rero-mef / 16621609190

30 Jul 2025 11:43AM UTC coverage: 84.491% (+0.008%) from 84.483%
16621609190

push

github

rerowep
chore: update dependencies

Co-Authored-by: Peter Weber <peter.weber@rero.ch>

4560 of 5397 relevant lines covered (84.49%)

0.84 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

66.67
/rero_mef/places/utils.py
1
# RERO MEF
2
# Copyright (C) 2021 RERO
3
#
4
# This program is free software: you can redistribute it and/or modify
5
# it under the terms of the GNU Affero General Public License as published by
6
# the Free Software Foundation, version 3 of the License.
7
#
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
# GNU Affero General Public License for more details.
12
#
13
# You should have received a copy of the GNU Affero General Public License
14
# along with this program. If not, see <http://www.gnu.org/licenses/>.
15

16
"""Utilities."""
17

18
from flask import current_app
1✔
19

20

21
def get_places_endpoints():
1✔
22
    """Get all places from config."""
23
    places = current_app.config.get("RERO_PLACES", [])
1✔
24
    endpoints = current_app.config.get("RECORDS_REST_ENDPOINTS", {})
1✔
25
    return {
1✔
26
        endpoint: data for endpoint, data in endpoints.items() if endpoint in places
27
    }
28

29

30
def make_identifier(identified_by):
1✔
31
    """Make identifier `type|(source)value`."""
32
    if source := identified_by.get("source"):
×
33
        return f"{identified_by['type']}|({source}){identified_by['value']}"
×
34
    return f"{identified_by['type']}:{identified_by['value']}"
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc