| 1 |
# SPDX-FileCopyrightText: Peter Pentchev <[email protected]> |
| 2 |
# SPDX-License-Identifier: GPL-2.0-or-later |
| 3 |
"""Unit tests for the output of `debsigs --features`.""" |
| 4 |
|
| 5 |
from __future__ import annotations |
| 6 |
|
| 7 |
import subprocess # noqa: S404 |
| 8 |
import typing |
| 9 |
|
| 10 |
from .util import test_cfg # noqa: F401 # pytest fixture |
| 11 |
|
| 12 |
|
| 13 |
if typing.TYPE_CHECKING: |
| 14 |
from typing import Final |
| 15 |
|
| 16 |
from . import util |
| 17 |
|
| 18 |
|
| 19 |
def test_version(test_cfg: util.ConfigAggr) -> None: # noqa: F811 # pytest fixture |
| 20 |
"""Make sure `debsigs --version` and `debsigs --features` agree.""" |
| 21 |
with test_cfg.cfg_with_tempd() as cfg: |
| 22 |
ver: Final = test_cfg.debsigs_features["debsigs"].value |
| 23 |
assert subprocess.check_output( # noqa: S603 |
| 24 |
[cfg.prog.debsigs, "--version"], |
| 25 |
cwd=cfg.path.work, |
| 26 |
encoding="UTF-8", |
| 27 |
env=cfg.env, |
| 28 |
).splitlines() == [f"debsigs v{ver}"] |