tests.test_version moduleΒΆ
- tests.test_version.test_token_int_none_for_non_integers(value)[source]ΒΆ
Token.integerisNonefor non-integer tokens.
- tests.test_version.test_token_mixed_type_not_equal()[source]ΒΆ
Integer and string tokens are never equal.
This holds even for a digit-like string compared across types.
- tests.test_version.test_tokenized_string_comparison_edge_cases()[source]ΒΆ
Comparison with
Noneand unsupported types.
- tests.test_version.test_tokenized_string_separators_and_pretty_print(v_string, expected_seps)[source]ΒΆ
- tests.test_version.test_tokenized_string_separators_and_lossy_pretty_print(v_string, expected_seps, expected_pp)[source]ΒΆ
- tests.test_version.test_underscore_post_release_tag_outranks_its_base(tag)[source]ΒΆ
Every tag of the set sorts above the release it suffixes.
Enumerating the set rather than sampling it is what keeps a tag added later from silently keeping the pre-release reading of the generic rule.
- tests.test_version.test_post_release_tag_needs_its_underscore(tag, separator)[source]ΒΆ
The same tag behind any other separator keeps the pre-release reading.
Gating on the underscore is what confines the Gentoo and Alpine reading to the two schemes spelling it that way, leaving a build identifier like
2.1.1-git-23hfb2ordered below its base.
- tests.test_version.test_version_range_empty_spec()[source]ΒΆ
Empty spec has no constraints, so any version satisfies it.
- tests.test_version.test_parse_version_is_tokenized_string()[source]ΒΆ
parse_versionis an alias forTokenizedString.
- tests.test_version.styled_split(styled)[source]ΒΆ
Recover the (prefix, suffix) boundary from a
diff_versions()result.The split has to be read back out of the colors, which is the only place the function records it. Slicing the inputs by an expected length instead compares the expectation against itself and passes whatever the function did, which is how this file spent its first year asserting nothing about where
diff_versions()actually cut.
- tests.test_version.test_diff_versions()[source]ΒΆ
Split every pair of the shared corpus where both frontends agree to.
tests/version-diff-cases.jsonis the contract, read here and bytestDiffVersions()intests/gnome/run-tests.js: the GNOME Shell extension carries a second implementation of this function, for a frontend Python never runs in, and nothing but one shared case list keeps the two honest. They had drifted on 17 of 21 pairs, the JS one stopping short of the separator introducing the diverging token and leaving it in the dimmed prefix.A case added to the file is asserted against both implementations on the next run. It is read here rather than parametrized from, so no worker stats the filesystem while collecting.