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

Method test_cmdline_copy_change_main

Lib/test/test_zipapp.py:427–435  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

425 self.assertTrue(cm.exception.code)
426
427 def test_cmdline_copy_change_main(self):
428 # Test copying an archive doesn't allow changing __main__.py.
429 original = self.make_archive()
430 target = self.tmpdir / 'target.pyz'
431 args = [str(original), '-o', str(target), '-m', 'foo:bar']
432 with self.assertRaises(SystemExit) as cm:
433 zipapp.main(args)
434 # Program should exit with a non-zero return code.
435 self.assertTrue(cm.exception.code)
436
437 @patch('sys.stdout', new_callable=io.StringIO)
438 def test_info_command(self, mock_stdout):

Callers

nothing calls this directly

Calls 5

make_archiveMethod · 0.95
strFunction · 0.85
assertTrueMethod · 0.80
assertRaisesMethod · 0.45
mainMethod · 0.45

Tested by

no test coverage detected