def test_set_build_result_call_script_direct_url(pre_existing_cli, capfd): with raises(SystemExit): set_build_result.main(['-h']) sout, _ = capfd.readouterr() assert '[--username' in sout assert '[--password' in sout assert '[--result' in sout assert '[--direct-url' in sout assert '[--java' in sout
def test_set_build_result_call_script_direct_url_no_trailing_slash(fake_java, env_base_url, capfd): with api_select.api(__file__): pre_existing_cli() base_url = test_cfg.direct_url().rstrip('/') set_build_result.main(['--direct-url', base_url])
def test_set_build_result_call_script_direct_url_no_trailing_slash(fake_java, pre_existing_cli, capfd): base_url = os.environ.get('JENKINSFLOW_DIRECT_URL') or 'http://localhost:8080' base_url = base_url[0:-1] if base_url[-1] == '/' else base_url set_build_result.main(['--direct-url', base_url])