mirror of
https://github.com/cdtools-developers/cdtools.git
synced 2026-09-11 14:02:38 +02:00
Merge pull request #54 from gnzng/versiontests
Add tests for version existence and semantic format
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
from cdtools import __version__
|
||||
import re
|
||||
|
||||
|
||||
def test_version_exists():
|
||||
"""Test that version is defined and not empty."""
|
||||
assert __version__
|
||||
assert isinstance(__version__, str)
|
||||
assert len(__version__) > 0
|
||||
|
||||
|
||||
def test_version_format():
|
||||
"""Test that version follows semantic versioning format."""
|
||||
# Basic semantic versioning pattern (X.Y.Z with optional pre-release)
|
||||
pattern = r"^\d+\.\d+\.\d+(?:[-.]?(?:alpha|beta|rc|dev)\d*)?$"
|
||||
assert re.match(
|
||||
pattern, __version__
|
||||
), f"Version '{__version__}' doesn't follow semantic versioning"
|
||||
Reference in New Issue
Block a user