Changeset View
Changeset View
Standalone View
Standalone View
swh/indexer/tests/test_metadata.py
Show First 20 Lines • Show All 765 Lines • ▼ Show 20 Lines | """) # noqa | ||||
def test_compute_metadata_pkginfo_utf8(self): | def test_compute_metadata_pkginfo_utf8(self): | ||||
raw_content = (b'''\ | raw_content = (b'''\ | ||||
Metadata-Version: 1.1 | Metadata-Version: 1.1 | ||||
Name: snowpyt | Name: snowpyt | ||||
Description-Content-Type: UNKNOWN | Description-Content-Type: UNKNOWN | ||||
Description: foo | Description: foo | ||||
Hydrology N\xc2\xb083 | Hydrology N\xc2\xb083 | ||||
''') # noqa | ''') # noqa | ||||
result = MAPPINGS["PythonPkginfoMapping"].translate(raw_content) | result = self.pkginfo_mapping.translate(raw_content) | ||||
self.assertEqual(result, { | self.assertEqual(result, { | ||||
'@context': 'https://doi.org/10.5063/schema/codemeta-2.0', | '@context': 'https://doi.org/10.5063/schema/codemeta-2.0', | ||||
'type': 'SoftwareSourceCode', | 'type': 'SoftwareSourceCode', | ||||
'name': 'snowpyt', | 'name': 'snowpyt', | ||||
'description': 'foo\nHydrology N°83', | 'description': 'foo\nHydrology N°83', | ||||
}) | }) | ||||
def test_compute_metadata_pkginfo_license(self): | def test_compute_metadata_pkginfo_license(self): | ||||
▲ Show 20 Lines • Show All 154 Lines • Show Last 20 Lines |