def main(): multiprocessing.freeze_support() import randovania randovania.setup_logging('INFO', None) logging.info("Starting Randovania...") from randovania import cli cli.run_cli(sys.argv)
def test_run_cli( mock_create_parser: MagicMock, mock_run_args: MagicMock, ): # Setup argv = [MagicMock(), MagicMock(), MagicMock()] # Run cli.run_cli(argv) # Assert mock_create_parser.return_value.parse_args.assert_called_once_with( argv[1:]) mock_run_args.assert_called_once_with( mock_create_parser.return_value.parse_args.return_value)
def test_run_cli(mock_create_parser: MagicMock, mock_run_args: MagicMock, ): # Setup argv = [MagicMock(), MagicMock(), MagicMock()] mock_run_args.return_value = 1234 # Run with pytest.raises(SystemExit) as p: cli.run_cli(argv) # Assert mock_create_parser.return_value.parse_args.assert_called_once_with(argv[1:]) mock_run_args.assert_called_once_with(mock_create_parser.return_value, mock_create_parser.return_value.parse_args.return_value) assert p.value.code == 1234
def main(): multiprocessing.freeze_support() cli.run_cli(sys.argv)