Coverage for apis_core/utils/test_normalize.py: 100%

15 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2024-09-16 07:42 +0000

1# SPDX-FileCopyrightText: 2023 Birger Schacht 

2# SPDX-License-Identifier: MIT 

3 

4from django.test import TestCase 

5 

6from apis_core.utils import normalize 

7 

8 

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) 

14 

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) 

19 

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)