It is not a separate package since Python 3.3 Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com> (cherry picked from commit 3987688de6720d951bfeb0b49c364df9738b490b)
		
			
				
	
	
		
			18 lines
		
	
	
		
			649 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			649 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")
 |