Esempio n. 1
0
def test_check_for_thread_safety_httplib2shim():
    global _USE_GAX
    _USE_GAX = False
    global _USE_GRPC
    _USE_GRPC = False
    client = MockClient()
    client.connection.http.__class__.__module__ = 'httplib2shim'
    utils._check_for_thread_safety(client)
Esempio n. 2
0
def test_check_for_thread_safety_httplib2shim():
    global _USE_GAX
    _USE_GAX = False
    global _USE_GRPC
    _USE_GRPC = False
    client = MockClient()
    client.connection.http.__class__.__module__ = 'httplib2shim'
    utils._check_for_thread_safety(client)
Esempio n. 3
0
def test_check_for_thread_safety_fail():
    global _USE_GAX
    _USE_GAX = False
    global _USE_GRPC
    _USE_GRPC = False
    client = MockClient()

    with pytest.raises(ValueError):
        utils._check_for_thread_safety(client)
Esempio n. 4
0
def test_check_for_thread_safety_key_and_attr_error():
    global _USE_GAX
    _USE_GAX = False
    global _USE_GRPC
    _USE_GRPC = False
    client = MockClientNoConnection(KeyError)
    utils._check_for_thread_safety(client)
    client = MockClientNoConnection(AttributeError)
    utils._check_for_thread_safety(client)
Esempio n. 5
0
def test_check_for_thread_safety_fail():
    global _USE_GAX
    _USE_GAX = False
    global _USE_GRPC
    _USE_GRPC = False
    client = MockClient()

    with pytest.raises(ValueError):
        utils._check_for_thread_safety(client)
Esempio n. 6
0
def test_check_for_thread_safety_key_and_attr_error():
    global _USE_GAX
    _USE_GAX = False
    global _USE_GRPC
    _USE_GRPC = False
    client = MockClientNoConnection(KeyError)
    utils._check_for_thread_safety(client)
    client = MockClientNoConnection(AttributeError)
    utils._check_for_thread_safety(client)
Esempio n. 7
0
def test_check_for_thread_safety_use_grpc():
    global _USE_GAX
    _USE_GAX = False
    global _USE_GRPC
    _USE_GRPC = True
    utils._check_for_thread_safety(MockClient())
Esempio n. 8
0
def test_check_for_thread_safety_use_gax():
    global _USE_GAX
    _USE_GAX = True
    utils._check_for_thread_safety(MockClient())
Esempio n. 9
0
def test_check_for_thread_safety_use_grpc():
    global _USE_GAX
    _USE_GAX = False
    global _USE_GRPC
    _USE_GRPC = True
    utils._check_for_thread_safety(MockClient())
Esempio n. 10
0
def test_check_for_thread_safety_use_gax():
    global _USE_GAX
    _USE_GAX = True
    utils._check_for_thread_safety(MockClient())