示例#1
0
def test_create_client(caplog):
    """Creates a GCSUtil with an access token."""
    caplog.set_level(logging.DEBUG, 'snowflake.connector')
    client = SnowflakeGCSUtil.create_client(
        {'creds': {
            'GCS_ACCESS_TOKEN': 'fake_token'
        }})
    assert client is not None
    assert client == 'fake_token'
示例#2
0
def test_create_client(caplog):
    """Creates a GCSUtil with an access token."""
    caplog.set_level(logging.DEBUG, "snowflake.connector")
    client = SnowflakeGCSUtil.create_client(
        {"creds": {
            "GCS_ACCESS_TOKEN": "fake_token"
        }})
    assert client is not None
    assert client == "fake_token"
示例#3
0
def test_create_client(caplog):
    """Creates a GCSUtil with an access token."""
    client = SnowflakeGCSUtil.create_client(
        {'creds': {
            'GCS_ACCESS_TOKEN': 'fake_token'
        }})
    assert client is None
    assert all([
        log in caplog.record_tuples for log in
        [('snowflake.connector.gcs_util', logging.DEBUG,
          "len(GCS_ACCESS_TOKEN): 10"),
         ('snowflake.connector.gcs_util', logging.DEBUG,
          "GCS operations with an access token are currently unsupported")]
    ])
def test_create_client(caplog):
    """Creates a GCSUtil with an access token."""
    client = SnowflakeGCSUtil.create_client({'creds': {'GCS_ACCESS_TOKEN': 'fake_token'}})
    assert client is not None
    assert client == 'fake_token'