File: test_classifier_checks.py

package info (click to toggle)
python-azure 20251014%2Bgit-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 766,472 kB
  • sloc: python: 6,314,744; ansic: 804; javascript: 287; makefile: 198; sh: 198; xml: 109
file content (22 lines) | stat: -rw-r--r-- 1,162 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import pytest

from ci_tools.functions import verify_package_classifiers


@pytest.mark.parametrize(
    "package_name, package_version, package_classifiers, expected_result",
    [
        ("a", "1.0.0", ["Development Status :: 4 - Beta"], False),
        ("b", "1.0.0", ["Development Status :: 5 - Production/Stable"], True),
        ("b", "1.0.0a1", ["Development Status :: 5 - Production/Stable"], False),
        ("b", "1.0.0a1", ["Development Status :: 4 - Beta"], True),
        ("c", "1.0.0b1", ["Development Status :: 4 - Beta"], True),
        ("c", "1.0.0b1", ["Development Status :: 4 - Beta", "Development Status :: 5 - Production/Stable"], False),
        ("c", "1.0.0", ["Development Status :: 4 - Beta", "Development Status :: 5 - Production/Stable"], False),
        ("c", "1.0.1", ["Development Status :: 7 - Inactive"], True),
        ("c", "1.0.1b1", ["Development Status :: 7 - Inactive"], False),
    ],
)
def test_classifier_enforcement(package_name, package_version, package_classifiers, expected_result):
    result = verify_package_classifiers(package_name, package_version, package_classifiers)
    assert result[0] is expected_result