def test_prepared_request_no_cookies_copy(): p = PreparedRequest() p.prepare(method='GET', url='http://www.example.com', data='foo=bar', hooks=default_hooks()) assert_copy(p, p.copy())
def test_prepared_copy(kwargs): p = PreparedRequest() if kwargs: p.prepare(**kwargs) copy = p.copy() for attr in ('method', 'url', 'headers', '_cookies', 'body', 'hooks'): assert getattr(p, attr) == getattr(copy, attr)
def test_prepared_request_no_cookies_copy(): p = PreparedRequest() p.prepare( method='GET', url='http://www.example.com', data='foo=bar', hooks=default_hooks() ) assert_copy(p, p.copy())
def test_prepared_request_complete_copy(): p = PreparedRequest() p.prepare(method="GET", url="http://www.example.com", data="foo=bar", hooks=default_hooks(), cookies={"foo": "bar"}) assert_copy(p, p.copy())
def test_prepared_request_empty_copy(): p = PreparedRequest() assert_copy(p, p.copy())