tests.test_purl_spec moduleΒΆ

Run the test suite of purl-spec against the pURL parser and renderer of mpm.

tests/purl-spec/ copies the LICENSE, the type definitions of types/ and the test suite of tests/ from the purl-spec v1.1.0 release. To move to a newer release:

  1. Replace the three with those of the release.

  2. Format the JSON files with repomatic run biome -- format --write tests/purl-spec.

  3. Fix the rows of PURL_TYPES that test_purl_types_match_their_definitions names.

typos skips the copy, per [tool.typos] in pyproject.toml.

tests.test_purl_spec.SPEC_CONTRADICTIONS = {'gem-test-0': 'Clause 5.6.6 of ECMA-427 allows lowercase qualifier keys only, and the required gem and rpm parse cases refuse an uppercase one, but this case accepts it: package-url/purl-spec#942 and package-url/purl-spec#1027.', 'git-test-0': 'The git definition keeps the case of the namespace and the name, but this case lowercases them.', 'maven-test-12': 'Clause 5.6.6 of ECMA-427 allows lowercase qualifier keys only, and the required gem and rpm parse cases refuse an uppercase one, but this case accepts it: package-url/purl-spec#942 and package-url/purl-spec#1027.', 'maven-test-13': 'Clause 5.6.6 of ECMA-427 allows lowercase qualifier keys only, and the required gem and rpm parse cases refuse an uppercase one, but this case accepts it: package-url/purl-spec#942 and package-url/purl-spec#1027.', 'maven-test-8': 'Clause 5.6.6 of ECMA-427 allows lowercase qualifier keys only, and the required gem and rpm parse cases refuse an uppercase one, but this case accepts it: package-url/purl-spec#942 and package-url/purl-spec#1027.', 'maven-test-9': 'Clause 5.6.6 of ECMA-427 allows lowercase qualifier keys only, and the required gem and rpm parse cases refuse an uppercase one, but this case accepts it: package-url/purl-spec#942 and package-url/purl-spec#1027.', 'rpm-test-0': 'Clause 5.6.6 of ECMA-427 allows lowercase qualifier keys only, and the required gem and rpm parse cases refuse an uppercase one, but this case accepts it: package-url/purl-spec#942 and package-url/purl-spec#1027.'}ΒΆ

Cases of the suite that contradict the standard or another case, by ID.

tests.test_purl_spec.test_purl_types_match_their_definitions()[source]ΒΆ

Each registered type has a row stating the rules of its definition.

tests.test_purl_spec.test_parse_case(case)[source]ΒΆ

parse_purl() splits each valid pURL of the suite, and refuses the others.

tests.test_purl_spec.test_validate_case(case)[source]ΒΆ

A pURL reads like its canonical form, and an invalid one is refused.

tests.test_purl_spec.test_build_case(case)[source]ΒΆ

render_purl() renders each valid set of parts, and refuses the others.