Ejemplo n.º 1
0
def test_azure_setgetstate():
    container = str(uuid())
    conn_string = create_azure_conn_string(load_azure_credentials())
    store = AzureBlockBlobStore(conn_string=conn_string, container=container)
    store.put(u'key1', b'value1')

    buf = pickle.dumps(store, protocol=2)
    store = pickle.loads(buf)

    assert store.get(u'key1') == b'value1'
    _delete_container(conn_string, container)
Ejemplo n.º 2
0
def test_azure_setgetstate():
    from azure.storage.blob import BlockBlobService
    container = uuid()
    conn_string = create_azure_conn_string(load_azure_credentials())
    s = BlockBlobService(connection_string=conn_string)
    store = AzureBlockBlobStore(conn_string=conn_string, container=container)
    store.put(u'key1', b'value1')

    buf = pickle.dumps(store, protocol=2)
    store = pickle.loads(buf)

    assert store.get(u'key1') == b'value1'
    s.delete_container(container)
Ejemplo n.º 3
0
def test_azure_setgetstate():
    from azure.storage.blob import BlockBlobService
    container = uuid()
    conn_string = create_azure_conn_string(load_azure_credentials())
    s = BlockBlobService(connection_string=conn_string)
    store = AzureBlockBlobStore(conn_string=conn_string, container=container)
    store.put(u'key1', b'value1')

    buf = pickle.dumps(store, protocol=2)
    store = pickle.loads(buf)

    assert store.get(u'key1') == b'value1'
    s.delete_container(container)
Ejemplo n.º 4
0
def test_azure_store_attributes():
    abbs = AzureBlockBlobStore('CONN_STR', 'CONTAINER',
                               max_connections=42, checksum=True)
    assert abbs.conn_string == 'CONN_STR'
    assert abbs.container == 'CONTAINER'
    assert abbs.public is False
    assert abbs.create_if_missing is True
    assert abbs.max_connections == 42
    assert abbs.checksum is True

    abbs2 = pickle.loads(pickle.dumps(abbs))
    assert abbs2.conn_string == 'CONN_STR'
    assert abbs2.container == 'CONTAINER'
    assert abbs2.public is False
    assert abbs2.create_if_missing is True
    assert abbs2.max_connections == 42
    assert abbs2.checksum is True