MCPcopy Index your code
hub / github.com/python/cpython / test_info_command

Method test_info_command

Lib/test/test_zipapp.py:438–446  ·  view source on GitHub ↗
(self, mock_stdout)

Source from the content-addressed store, hash-verified

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.

Callers

nothing calls this directly

Calls 6

make_archiveMethod · 0.95
strFunction · 0.85
assertRaisesMethod · 0.45
mainMethod · 0.45
assertEqualMethod · 0.45
getvalueMethod · 0.45

Tested by

no test coverage detected