def test_submit_real(mode, user_format, file, seq, skipPDB, email, name, silent, host): response = jpredapi.submit(mode=mode, user_format=user_format, file=file, seq=seq, skipPDB=skipPDB, email=email, name=name, silent=silent, host=host) assert response.status_code == 202 and "Created JPred job" or "You have successfully submitted" in response.text
def test_get_results_real(results_dir_path, extract, silent, host, jpred4): job_response = jpredapi.submit(mode="single", user_format="raw", seq="MQVWPIEGIKKFETLSYLPP") result_url = job_response.headers['Location'] jobid = re.search(r"(jp_.*)$", result_url).group(1) response = jpredapi.get_results(jobid=jobid, results_dir_path=results_dir_path, extract=extract, silent=silent, host=host, jpred4=jpred4) assert response.status_code == 200
def test_submit(mode, user_format, file, seq, skipPDB, email, name, silent, host): with patch('jpredapi.submit') as mock_submit: mock_submit.return_value.status_code = 202 mock_submit.return_value.text = "Created JPred job" response = jpredapi.submit(mode=mode, user_format=user_format, file=file, seq=seq, skipPDB=skipPDB, email=email, name=name, silent=silent, host=host) assert response.status_code == 202 and "Created JPred job" or "You have successfully submitted" in response.text
def submit_jpred(sequence): return jpredapi.submit(mode="single", user_format="raw", seq=sequence)