public
Description: Python client wrapper for Windows Azure storage
Homepage: http://www.sriramkrishnan.com/blog/2008/11/python-wrapper-for-windows-azure.html
Clone URL: git://github.com/sriramk/winazurestorage.git
winazurestorage / test.py
100644 24 lines (21 sloc) 0.774 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from winazurestorage import *
 
def do_blob_tests():
    '''Expected output:
Starting blob tests
create_container: 201
put_blob: 201
get_blob: Hello, World!
delete_container: 202
Done.
'''
    print "Starting blob tests"
    blobs = BlobStorage()
    print "\tcreate_container: %d" % blobs.create_container("testcontainer", True)
    print "\tput_blob: %d" % blobs.put_blob("testcontainer", "testblob.txt", "Hello, World!", "text/plain")
    print "\tget_blob: %s" % blobs.get_blob("testcontainer", "testblob.txt")
    print "\tdelete_container: %d" % blobs.delete_container("testcontainer")
    print "Done."
 
def run_tests():
    do_blob_tests()
 
if __name__ == '__main__':
    run_tests()