From c08fddb443a5f39914d63b4a024326ff1936f717 Mon Sep 17 00:00:00 2001 From: deeplow Date: Fri, 23 Dec 2022 11:42:23 +0000 Subject: [PATCH] Add unit test for --version --- tests/test_cli.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_cli.py b/tests/test_cli.py index fcc330f..d489a49 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -3,6 +3,7 @@ from __future__ import annotations import contextlib import copy import os +import re import shutil import sys import tempfile @@ -163,6 +164,14 @@ class TestCliBasic(TestCli): for line in plain_lines: assert len(line) == banner_width, "banner has inconsistent width" + def test_version(self) -> None: + result = self.run_cli("--version") + result.assert_success() + + with open("share/version.txt") as f: + version = f.read().strip() + assert version in result.stdout + class TestCliConversion(TestCliBasic): def test_invalid_lang(self) -> None: