python-constraint2 2.0.0__cp310-cp310-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,72 @@
1
+ """Tests for release information."""
2
+
3
+ from pathlib import Path
4
+
5
+ import tomli
6
+
7
+ package_root = Path(".").parent.parent
8
+ pyproject_toml_path = package_root / "pyproject.toml"
9
+ assert pyproject_toml_path.exists()
10
+ with open(pyproject_toml_path, mode="rb") as fp:
11
+ pyproject = tomli.load(fp)
12
+ project = pyproject["project"] if "project" in pyproject else pyproject["tool"]["poetry"]
13
+
14
+
15
+ def test_read():
16
+ """Test whether the contents have been read correctly and the required keys are in place."""
17
+ assert isinstance(pyproject, dict)
18
+ assert "build-system" in pyproject
19
+
20
+
21
+ def test_name():
22
+ """Ensure the name is consistent."""
23
+ assert "name" in project
24
+ assert project["name"] == "python-constraint2"
25
+
26
+
27
+ def test_versioning():
28
+ """Test whether the versioning is PEP440 compliant."""
29
+ from pep440 import is_canonical
30
+
31
+ assert "version" in project
32
+ assert is_canonical(project["version"])
33
+
34
+
35
+ def test_authors():
36
+ """Ensure the authors are specified."""
37
+ assert "authors" in project
38
+ assert len(project["authors"]) > 0
39
+
40
+
41
+ def test_license():
42
+ """Ensure the license is set and the file exists."""
43
+ assert "license" in project
44
+ license = project["license"]
45
+ if isinstance(license, dict):
46
+ assert "file" in license
47
+ license = project["license"]["file"]
48
+ assert isinstance(license, str)
49
+ assert len(license) > 0
50
+ if license == "LICENSE":
51
+ assert Path(package_root / license).exists()
52
+
53
+
54
+ def test_readme():
55
+ """Ensure the readme is set and the file exists."""
56
+ assert "readme" in project
57
+ readme = project["readme"]
58
+ if isinstance(readme, dict):
59
+ assert "file" in readme
60
+ readme = project["readme"]["file"]
61
+ assert isinstance(readme, str)
62
+ assert len(readme) > 0
63
+ assert readme[:6] == "README"
64
+ assert Path(package_root / readme).exists()
65
+
66
+
67
+ def test_project_keys():
68
+ """Check whether the expected keys in [project] or [tool.poetry] are present."""
69
+ assert "description" in project
70
+ assert "keywords" in project
71
+ assert "classifiers" in project
72
+ assert "requires-python" in project or "python" in pyproject["tool"]["poetry"]["dependencies"]