def METHOD_NAME(core_manager):
    # test that in case of `shutting_down` and `should_quit_app_on_core_finished` flags have been set to True
    # then `quit_application` method will be called and Exception will not be raised
    core_manager.shutting_down = True
    core_manager.should_quit_app_on_core_finished = True
    core_manager.on_core_finished(exit_code=1, exit_status='exit status')
    core_manager.app_manager.quit_application.assert_called_once()