#!/usr/bin/python3
"""Tests for slpkg/views/version.py using pytest."""

from unittest.mock import patch

import pytest
from slpkg.views.version import Version


def test_version_view(capsys):
    """Test printing the version info."""
    with patch("slpkg.views.version.config_load") as mock_config:
        mock_config.cpu_arch = "x86_64"
        v = Version()
        v.version = "TEST-VERSION"
        v.view()
        
        captured = capsys.readouterr()
        assert "slpkg TEST-VERSION (x86_64)" in captured.out
        assert "License: GPLv3" in captured.out
        assert "https://dslackw.gitlab.io/slpkg" in captured.out
