pungi/tests/test_arguments.py
Lubomír Sedlář 4ff13b1993 Drop usage of six
We no longer need to support Python 2, so there's no point in this
compatibility layer.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>

(cherry picked from commit b34de57813187f1781aef733468c9745a144d9af)
2025-09-29 18:23:44 +03:00

19 lines
650 B
Python

from unittest import mock
import io
import unittest
from pungi.scripts.pungi_koji import cli_main
class PungiKojiTestCase(unittest.TestCase):
@mock.patch("sys.argv", new=["prog", "--version"])
@mock.patch("sys.stderr", new_callable=io.StringIO)
@mock.patch("sys.stdout", new_callable=io.StringIO)
@mock.patch("pungi.scripts.pungi_koji.get_full_version", return_value="a-b-c.111")
def test_version(self, get_full_version, stdout, stderr):
with self.assertRaises(SystemExit) as cm:
cli_main()
self.assertEqual(cm.exception.code, 0)
self.assertMultiLineEqual(stdout.getvalue(), "a-b-c.111\n")