示例#1
0
def test_azure_session_class():
    """AzureSession works"""
    azure_session = AzureSession(azure_storage_account='foo',
                                 azure_storage_access_key='bar')
    assert azure_session._creds
    assert azure_session.get_credential_options(
    )['AZURE_STORAGE_ACCOUNT'] == 'foo'
    assert azure_session.get_credential_options(
    )['AZURE_STORAGE_ACCESS_KEY'] == 'bar'
示例#2
0
def test_azure_session_class_connection_string():
    """AzureSession works"""
    azure_session = AzureSession(
        azure_storage_connection_string=
        'AccountName=myaccount;AccountKey=MY_ACCOUNT_KEY')
    assert azure_session._creds
    assert (azure_session.get_credential_options()
            ['AZURE_STORAGE_CONNECTION_STRING'] ==
            'AccountName=myaccount;AccountKey=MY_ACCOUNT_KEY')
示例#3
0
def test_azure_session_class_unsigned():
    """AzureSession works"""
    sesh = AzureSession(azure_unsigned=True, azure_storage_account='naipblobs')
    assert sesh.get_credential_options()['AZURE_NO_SIGN_REQUEST'] == 'YES'
    assert sesh.get_credential_options(
    )['AZURE_STORAGE_ACCOUNT'] == 'naipblobs'