def test_it_pops_matching_params(self, create_environ): environ = create_environ("one=1&two=2&aprefix.three=3&four=4") params = pop_query_params_with_prefix(environ, "aprefix.") expected_environ = create_environ("one=1&two=2&four=4") assert params == {"aprefix.three": "3"} assert environ == expected_environ
def test_it_ignores_non_matching_params(self, create_environ): environ = create_environ("one=1&two=2&three=3") orig_envion = environ.copy() params = pop_query_params_with_prefix(environ, "aprefix.") assert params == {} assert environ == orig_envion
def test_it_ignores_non_matching_params(self, create_environ): environ = create_environ("one=1&two=2&three=3") orig_envion = environ.copy() params = pop_query_params_with_prefix(environ, "aprefix.") assert params == {} assert environ == orig_envion
def test_it_pops_matching_params(self, create_environ): environ = create_environ("one=1&two=2&aprefix.three=3&four=4") params = pop_query_params_with_prefix(environ, "aprefix.") expected_environ = create_environ("one=1&two=2&four=4") assert params == {"aprefix.three": "3"} assert environ == expected_environ
def test_it_pops_matching_params(self, create_environ): environ = create_environ('one=1&two=2&aprefix.three=3&four=4') params = pop_query_params_with_prefix(environ, 'aprefix.') expected_environ = create_environ('one=1&two=2&four=4') assert params == {'aprefix.three': '3'} assert environ == expected_environ