예제 #1
0
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())
예제 #2
0
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)
예제 #3
0
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)
예제 #4
0
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())
예제 #5
0
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())
예제 #6
0
def test_prepared_request_empty_copy():
    p = PreparedRequest()
    assert_copy(p, p.copy())
예제 #7
0
def test_prepared_request_empty_copy():
    p = PreparedRequest()
    assert_copy(p, p.copy())