Fix pungi-koji --version
Signed-off-by: dowang <dowang@redhat.com>
This commit is contained in:
parent
3ef2a65275
commit
adaab46bf7
3 changed files with 26 additions and 5 deletions
19
tests/test_arguments.py
Normal file
19
tests/test_arguments.py
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import mock
|
||||
import unittest
|
||||
import six
|
||||
import pungi
|
||||
|
||||
from helpers import load_bin
|
||||
|
||||
cli = load_bin("pungi-koji")
|
||||
|
||||
|
||||
class PungiKojiTestCase(unittest.TestCase):
|
||||
|
||||
@mock.patch('sys.argv', new=['prog', '--version'])
|
||||
@mock.patch('sys.stderr', new_callable=six.StringIO)
|
||||
@mock.patch('pungi_cli_fake_pungi-koji.get_full_version', return_value='a-b-c.111')
|
||||
def test_version(self, get_full_version, stderr):
|
||||
with self.assertRaises(SystemExit):
|
||||
cli.main()
|
||||
self.assertMultiLineEqual(stderr.getvalue(), 'a-b-c.111\n')
|
||||
Loading…
Add table
Add a link
Reference in a new issue