Ejemplo n.º 1
0
def test_takes_environment(client_open_mock):
    instance = Client(None)
    environ_base = {'foo': 'bar'}
    instance.open('/', environ_base=environ_base)
    client_open_mock.assert_called_once_with(
        '/',
        environ_base=environ_base,
    )
Ejemplo n.º 2
0
def test_patch_ip_sends_along_ip(client_open_mock):
    instance = Client(None)
    remote_addr = object()
    with instance.patch_ip(remote_addr):
        instance.open('/')
        client_open_mock.assert_called_once_with(
            '/',
            environ_base={'REMOTE_ADDR': remote_addr},
        )
Ejemplo n.º 3
0
def test_return_value_is_testing_response(client_open_mock):
    instance = Client(None)
    ret = instance.open('/')
    assert isinstance(ret, Response)
Ejemplo n.º 4
0
def test_return_value_is_testing_response(client_open_mock):
    instance = Client(None)
    ret = instance.open('/')
    assert isinstance(ret, Response)