File: _pyproject_test.py

package info (click to toggle)
wand 0.7.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 13,812 kB
  • sloc: python: 14,250; makefile: 113
file content (22 lines) | stat: -rw-r--r-- 603 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
from pathlib import Path
from pytest import mark
from wand.version import VERSION
try:
    import tomllib
except ImportError:
    tomllib = None

CFG_ROOT = Path(__file__).parent.parent
CFG_PATH = CFG_ROOT / "pyproject.toml"

def test_pyproject_exists():
    assert CFG_PATH.exists()

@mark.skipif(tomllib is None, reason="tomllib not available")
def test_pyproject_valid():
    with open(CFG_PATH, 'rb') as fd:
        cfg = tomllib.load(fd)
    assert 'project' in cfg
    project = cfg.get('project', {})
    assert project.get('name') in ['wand', 'Wand']
    assert project.get('version') == VERSION