def post_choose_inherited_env(url): response = yield http_get_async(url) assert response.code == 200 body = response.body.decode('utf-8') assert 'activated environment' in body form_names = _form_names(response, provider='CondaEnvProvider') form = _prefix_form(form_names, {'source': 'inherited'}) response = yield http_post_async(url, form=form) assert response.code == 200
def do_http(): http_results['get'] = yield http_get_async(url) # pick our environment (using inherited one) form_names = _form_names(http_results['get'], provider='CondaEnvProvider') form = _prefix_form(form_names, {'source': 'inherited'}) response = yield http_post_async(url, form=form) assert response.code == 200 # now do the next round of stuff (the FOO variable) http_results['post'] = yield http_post_async(url, body="")
def do_http(): http_results['get_click_submit'] = get_response = yield http_get_async(url) if get_response.code != 200: raise Exception("got a bad http response " + repr(get_response)) http_results['post_click_submit'] = post_response = yield http_post_async(url, body="") assert 200 == post_response.code assert '</form>' in str(post_response.body) assert 'FOO_PASSWORD' in str(post_response.body) fill_in_password(url, post_response)
def get_initial(url): response = yield http_get_async(url) assert response.code == 200 body = response.body.decode('utf-8') assert "Download {} to {}".format('http://example.com/bar?error=true', 'bar') in body _verify_choices( response, ( # by default, perform the download ('download', True), # allow typing in a manual value ('variables', False)))
def get_initial(url): response = yield http_get_async(url) assert response.code == 200 body = response.body.decode('utf-8') stuff['form_names'] = _form_names(response) assert "Download {} to {}".format('http://example.com/bar', 'bar') in body _verify_choices( response, ( # offer to perform the download but by default use the preset env var ('download', False), # by default, keep env var ('environ', True), # allow typing in a manual value ('variables', False)))