mirror of
https://github.com/enpaul/peewee-plus.git
synced 2025-09-18 17:38:38 +00:00
Add check for __all__ items
This commit is contained in:
40
tests/test_meta.py
Normal file
40
tests/test_meta.py
Normal file
@@ -0,0 +1,40 @@
|
||||
"""Test that metadata module matches pyproject"""
|
||||
from pathlib import Path
|
||||
|
||||
import toml
|
||||
|
||||
import peewee_plus
|
||||
|
||||
|
||||
def test_about():
|
||||
"""Test metadata values"""
|
||||
|
||||
with (Path(__file__).resolve().parent.parent / "pyproject.toml").open() as infile:
|
||||
pyproject = toml.load(infile)
|
||||
|
||||
assert pyproject["tool"]["poetry"]["name"] == peewee_plus.__title__
|
||||
assert pyproject["tool"]["poetry"]["version"] == peewee_plus.__version__
|
||||
assert pyproject["tool"]["poetry"]["license"] == peewee_plus.__license__
|
||||
assert pyproject["tool"]["poetry"]["description"] == peewee_plus.__summary__
|
||||
assert pyproject["tool"]["poetry"]["repository"] == peewee_plus.__url__
|
||||
assert (
|
||||
all(
|
||||
item in peewee_plus.__authors__
|
||||
for item in pyproject["tool"]["poetry"]["authors"]
|
||||
)
|
||||
is True
|
||||
)
|
||||
assert (
|
||||
all(
|
||||
item in pyproject["tool"]["poetry"]["authors"]
|
||||
for item in peewee_plus.__authors__
|
||||
)
|
||||
is True
|
||||
)
|
||||
|
||||
|
||||
def test_all():
|
||||
"""Test that the string entries in ``__all__`` are correct"""
|
||||
|
||||
for item in peewee_plus.__all__:
|
||||
assert hasattr(peewee_plus, item)
|
Reference in New Issue
Block a user