def test_create_client():
    to = mock.MagicMock()
    to.max_retries = None

    sa = azops.StorageAccount('name', 'AAAAAA==', 'core.windows.net', 10, to,
                              mock.MagicMock())
    client = ops.create_client(sa, to, mock.MagicMock())
    assert client is not None
    assert isinstance(client, azure.storage.file.FileService)
    assert isinstance(
        client.authentication,
        azure.storage.common._auth._StorageSharedKeyAuthentication)
    assert client._USER_AGENT_STRING.startswith('blobxfer/{}'.format(
        blobxfer.version.__version__))
    assert client._httpclient.proxies is not None

    sa = azops.StorageAccount('name', '?key&sig=key', 'core.windows.net', 10,
                              to, None)
    client = ops.create_client(sa, to, None)
    assert client is not None
    assert isinstance(client, azure.storage.file.FileService)
    assert isinstance(client.authentication,
                      azure.storage.common._auth._StorageSASAuthentication)
    assert client._USER_AGENT_STRING.startswith('blobxfer/{}'.format(
        blobxfer.version.__version__))
    assert client._httpclient.proxies is None
def test_create_client():
    sa = azops.StorageAccount('name', 'key', 'endpoint', 10, mock.MagicMock())
    client = ops.create_client(sa, mock.MagicMock())
    assert client is not None
    assert isinstance(client, azure.storage.file.FileService)
    assert isinstance(
        client.authentication,
        azure.storage.common._auth._StorageSharedKeyAuthentication)
    assert client._USER_AGENT_STRING.startswith(
        'blobxfer/{}'.format(blobxfer.version.__version__))

    sa = azops.StorageAccount(
        'name', '?key&sig=key', 'endpoint', 10, mock.MagicMock())
    client = ops.create_client(sa, mock.MagicMock())
    assert client is not None
    assert isinstance(client, azure.storage.file.FileService)
    assert isinstance(
        client.authentication,
        azure.storage.common._auth._StorageSASAuthentication)
    assert client._USER_AGENT_STRING.startswith(
        'blobxfer/{}'.format(blobxfer.version.__version__))