2023-12-21 14:13:31 +03:00
|
|
|
from __future__ import annotations
|
2020-01-27 14:46:52 +03:00
|
|
|
import pytest
|
2020-08-07 13:28:33 +03:00
|
|
|
|
2018-04-11 12:05:09 +03:00
|
|
|
from PIL import __version__
|
2014-09-30 00:14:32 +04:00
|
|
|
|
2020-02-18 15:30:56 +03:00
|
|
|
pyroma = pytest.importorskip("pyroma", reason="Pyroma not installed")
|
2014-06-29 00:48:14 +04:00
|
|
|
|
|
|
|
|
2020-01-27 14:46:52 +03:00
|
|
|
def test_pyroma():
|
|
|
|
# Arrange
|
|
|
|
data = pyroma.projectdata.get_data(".")
|
2014-06-29 00:48:14 +04:00
|
|
|
|
2020-01-27 14:46:52 +03:00
|
|
|
# Act
|
|
|
|
rating = pyroma.ratings.rate(data)
|
2014-06-29 00:48:14 +04:00
|
|
|
|
2020-01-27 14:46:52 +03:00
|
|
|
# Assert
|
|
|
|
if "rc" in __version__:
|
|
|
|
# Pyroma needs to chill about RC versions and not kill all our tests.
|
|
|
|
assert rating == (
|
|
|
|
9,
|
|
|
|
["The package's version number does not comply with PEP-386."],
|
|
|
|
)
|
2014-09-30 00:14:32 +04:00
|
|
|
|
2020-01-27 14:46:52 +03:00
|
|
|
else:
|
|
|
|
# Should have a perfect score
|
|
|
|
assert rating == (10, [])
|