def test_get_thread_local_requests_returns_back_request_if_present():
    assert thread_local.get_thread_local_requests() == ['foo']
Пример #2
0
def test_get_thread_local_requests_returns_back_request_if_present():
    assert thread_local.get_thread_local_requests() == ['foo']
def test_get_thread_local_requests_creates_empty_list_if_not_attached():
    delattr(thread_local._thread_local, "requests")
    assert not hasattr(thread_local._thread_local, "requests")
    assert thread_local.get_thread_local_requests() == []
    assert hasattr(thread_local._thread_local, "requests")
Пример #4
0
def test_get_thread_local_requests_creates_empty_list_if_not_attached():
    delattr(thread_local._thread_local, "requests")
    assert not hasattr(thread_local._thread_local, "requests")
    assert thread_local.get_thread_local_requests() == []
    assert hasattr(thread_local._thread_local, "requests")