Coverage for apis_core/utils/test_normalize.py: 100%
15 statements
« prev ^ index » next coverage.py v7.6.4, created at 2024-11-22 07:51 +0000
« prev ^ index » next coverage.py v7.6.4, created at 2024-11-22 07:51 +0000
1# SPDX-FileCopyrightText: 2023 Birger Schacht
2# SPDX-License-Identifier: MIT
4from django.test import TestCase
6from apis_core.utils import normalize
9class NormalizeTest(TestCase):
10 def test_clean_uri_geonames(self):
11 uri = "https://www.geonames.org/2783029/achensee.html"
12 res = "https://sws.geonames.org/2783029/"
13 self.assertEqual(normalize.clean_uri(uri), res)
15 def test_clean_uri_wikidata(self):
16 uri = "https://www.wikidata.org/wiki/Q1735"
17 res = "http://www.wikidata.org/entity/Q1735"
18 self.assertEqual(normalize.clean_uri(uri), res)
20 def test_clean_uri_dnb(self):
21 uri = "https://d-nb.info/gnd/118540475"
22 res = "https://d-nb.info/gnd/118540475"
23 self.assertEqual(normalize.clean_uri(uri), res)