Files
voculinux/tests/test_version.py
T
xavierk 80a3792576
CI / security (pull_request) Failing after 1m25s
CI / lint (pull_request) Failing after 34s
CI / ai-review (pull_request) Successful in 25s
chore: import vocalinux project
Import the vocalinux source tree (tray app, Next.js site in web/,
packaging, installers, docs and tests) on top of the Gitea template
commit. The project README replaces the template README, and the
template CI files (.gitea/workflows/ci.yml, .jscpd.json, CI.md) are kept.
2026-11-06 11:51:44 +05:30

65 lines
2.3 KiB
Python

"""
Tests for the version module.
"""
import unittest
class TestVersion(unittest.TestCase):
"""Test cases for version information."""
def test_version_exists(self):
"""Test that version string exists and is valid."""
from vocalinux.version import __version__
self.assertIsInstance(__version__, str)
self.assertTrue(len(__version__) > 0)
# Version should follow semver-like pattern
parts = __version__.replace("-", ".").split(".")
self.assertTrue(len(parts) >= 3)
def test_package_version_matches_version_module(self):
"""Package root re-exports version.py so import vocalinux.__version__ is correct."""
import vocalinux
from vocalinux.version import __version__
self.assertEqual(vocalinux.__version__, __version__)
def test_version_info_tuple(self):
"""Test that version info tuple exists and is valid."""
from vocalinux.version import __version_info__
self.assertIsInstance(__version_info__, tuple)
self.assertTrue(len(__version_info__) >= 3)
# First three elements should be integers
self.assertIsInstance(__version_info__[0], int)
self.assertIsInstance(__version_info__[1], int)
self.assertIsInstance(__version_info__[2], int)
def test_author_info(self):
"""Test that author information exists."""
from vocalinux.version import __author__, __email__
self.assertIsInstance(__author__, str)
self.assertTrue(len(__author__) > 0)
self.assertIsInstance(__email__, str)
self.assertIn("@", __email__)
def test_license_info(self):
"""Test that license information exists."""
from vocalinux.version import __copyright__, __license__
self.assertIsInstance(__license__, str)
self.assertTrue(len(__license__) > 0)
self.assertIsInstance(__copyright__, str)
self.assertIn("Copyright", __copyright__)
def test_url_and_description(self):
"""Test that URL and description exist."""
from vocalinux.version import __description__, __url__
self.assertIsInstance(__url__, str)
self.assertTrue(__url__.startswith("http"))
self.assertIsInstance(__description__, str)
self.assertTrue(len(__description__) > 0)