(self, mock_stdout)
| 436 | |
| 437 | @patch('sys.stdout', new_callable=io.StringIO) |
| 438 | def test_info_command(self, mock_stdout): |
| 439 | # Test the output of the info command. |
| 440 | target = self.make_archive() |
| 441 | args = [str(target), '--info'] |
| 442 | with self.assertRaises(SystemExit) as cm: |
| 443 | zipapp.main(args) |
| 444 | # Program should exit with a zero return code. |
| 445 | self.assertEqual(cm.exception.code, 0) |
| 446 | self.assertEqual(mock_stdout.getvalue(), "Interpreter: <none>\n") |
| 447 | |
| 448 | def test_info_error(self): |
| 449 | # Test the info command fails when the archive does not exist. |
nothing calls this directly
no test coverage detected