<s> import os <EOL> import os . path <EOL> import random <EOL> import sys <EOL> import copy <EOL> import unittest <EOL> import httplib <EOL> import libcloud . utils <EOL> from libcloud . common . types import LibcloudError <EOL> from libcloud . storage . base import Container , Object <EOL> from libcloud . storage . types import ContainerAlreadyExistsError <EOL> from libcloud . storage . types import ContainerDoesNotExistError <EOL> from libcloud . storage . types import ContainerIsNotEmptyError <EOL> from libcloud . storage . types import ObjectDoesNotExistError <EOL> from libcloud . storage . types import ObjectHashMismatchError <EOL> from libcloud . storage . drivers . cloudfiles import CloudFilesStorageDriver <EOL> from libcloud . storage . drivers . dummy import DummyFileObject , DummyIterator <EOL> from test import MockHttp , MockRawResponse <EOL> from test . file_fixtures import StorageFileFixtures <EOL> class CloudFilesTests ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> CloudFilesStorageDriver . connectionCls . conn_classes = ( None , <EOL> CloudFilesMockHttp ) <EOL> CloudFilesStorageDriver . connectionCls . rawResponseCls = CloudFilesMockRawResponse <EOL> CloudFilesMockHttp . type = None <EOL> CloudFilesMockRawResponse . type = None <EOL> self . driver = CloudFilesStorageDriver ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . _remove_test_file ( ) <EOL> def tearDown ( self ) : <EOL> self . _remove_test_file ( ) <EOL> def test_get_meta_data ( self ) : <EOL> meta_data = self . driver . get_meta_data ( ) <EOL> def test_list_containers ( self ) : <EOL> CloudFilesMockHttp . type = '<STR_LIT>' <EOL> containers = self . driver . list_containers ( ) <EOL> self . assertEqual ( len ( containers ) , <NUM_LIT:0> ) <EOL> CloudFilesMockHttp . type = None <EOL> containers = self . driver . list_containers ( ) <EOL> self . assertEqual ( len ( containers ) , <NUM_LIT:3> ) <EOL> container = [ c for c in containers if c . name == '<STR_LIT>' ] [ <NUM_LIT:0> ] <EOL> self . assertEqual ( container . extra [ '<STR_LIT>' ] , <NUM_LIT> ) <EOL> self . assertEqual ( container . extra [ '<STR_LIT:size>' ] , <NUM_LIT> ) <EOL> def test_list_container_objects ( self ) : <EOL> CloudFilesMockHttp . type = '<STR_LIT>' <EOL> container = Container ( name = '<STR_LIT>' , extra = { } , driver = self . driver ) <EOL> objects = self . driver . list_container_objects ( container = container ) <EOL> self . assertEqual ( len ( objects ) , <NUM_LIT:0> ) <EOL> CloudFilesMockHttp . type = None <EOL> objects = self . driver . list_container_objects ( container = container ) <EOL> self . assertEqual ( len ( objects ) , <NUM_LIT:4> ) <EOL> obj = [ o for o in objects if o . name == '<STR_LIT>' ] [ <NUM_LIT:0> ] <EOL> self . assertEqual ( obj . hash , '<STR_LIT>' ) <EOL> self . assertEqual ( obj . size , <NUM_LIT> ) <EOL> self . assertEqual ( obj . container . name , '<STR_LIT>' ) <EOL> def test_get_container ( self ) : <EOL> container = self . driver . get_container ( container_name = '<STR_LIT>' ) <EOL> self . assertEqual ( container . name , '<STR_LIT>' ) <EOL> self . assertEqual ( container . extra [ '<STR_LIT>' ] , <NUM_LIT> ) <EOL> self . assertEqual ( container . extra [ '<STR_LIT:size>' ] , <NUM_LIT> ) <EOL> def test_get_object ( self ) : <EOL> obj = self . driver . get_object ( container_name = '<STR_LIT>' , <EOL> object_name = '<STR_LIT>' ) <EOL> self . assertEqual ( obj . container . name , '<STR_LIT>' ) <EOL> self . assertEqual ( obj . size , <NUM_LIT> ) <EOL> self . assertEqual ( obj . extra [ '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> self . assertEqual ( obj . extra [ '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> self . assertEqual ( obj . extra [ '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> self . assertEqual ( obj . meta_data [ '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> self . assertEqual ( obj . meta_data [ '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> def test_create_container_success ( self ) : <EOL> container = self . driver . create_container ( container_name = '<STR_LIT>' ) <EOL> self . assertTrue ( isinstance ( container , Container ) ) <EOL> self . assertEqual ( container . name , '<STR_LIT>' ) <EOL> self . assertEqual ( container . extra [ '<STR_LIT>' ] , <NUM_LIT:0> ) <EOL> def test_create_container_already_exists ( self ) : <EOL> CloudFilesMockHttp . type = '<STR_LIT>' <EOL> try : <EOL> container = self . driver . create_container ( container_name = '<STR_LIT>' ) <EOL> except ContainerAlreadyExistsError : <EOL> pass <EOL> else : <EOL> self . fail ( '<STR_LIT>' ) <EOL> def test_create_container_invalid_name ( self ) : <EOL> try : <EOL> container = self . driver . create_container ( container_name = '<STR_LIT>' ) <EOL> except : <EOL> pass <EOL> else : <EOL> self . fail ( '<STR_LIT>' ) <EOL> def test_create_container_invalid_name ( self ) : <EOL> name = '<STR_LIT>' . join ( [ '<STR_LIT:x>' for x in range ( <NUM_LIT:0> , <NUM_LIT> ) ] ) <EOL> try : <EOL> container = self . driver . create_container ( container_name = name ) <EOL> except : <EOL> pass <EOL> else : <EOL> self . fail ( '<STR_LIT>' ) <EOL> def test_delete_container_success ( self ) : <EOL> container = Container ( name = '<STR_LIT>' , extra = { } , driver = self ) <EOL> result = self . driver . delete_container ( container = container ) <EOL> self . assertTrue ( result ) <EOL> def test_delete_container_not_found ( self ) : <EOL> CloudFilesMockHttp . type = '<STR_LIT>' <EOL> container = Container ( name = '<STR_LIT>' , extra = { } , driver = self ) <EOL> try : <EOL> result = self . driver . delete_container ( container = container ) <EOL> except ContainerDoesNotExistError : <EOL> pass <EOL> else : <EOL> self . fail ( '<STR_LIT>' ) <EOL> def test_delete_container_not_empty ( self ) : <EOL> CloudFilesMockHttp . type = '<STR_LIT>' <EOL> container = Container ( name = '<STR_LIT>' , extra = { } , driver = self ) <EOL> try : <EOL> result = self . driver . delete_container ( container = container ) <EOL> except ContainerIsNotEmptyError : <EOL> pass <EOL> else : <EOL> self . fail ( '<STR_LIT>' ) <EOL> def test_download_object_success ( self ) : <EOL> container = Container ( name = '<STR_LIT>' , extra = { } , driver = self ) <EOL> obj = Object ( name = '<STR_LIT>' , size = <NUM_LIT:1000> , hash = None , extra = { } , <EOL> container = container , meta_data = None , <EOL> driver = CloudFilesStorageDriver ) <EOL> destination_path = os . path . abspath ( __file__ ) + '<STR_LIT>' <EOL> result = self . driver . download_object ( obj = obj , <EOL> destination_path = destination_path , <EOL> overwrite_existing = False , <EOL> delete_on_failure = True ) <EOL> self . assertTrue ( result ) <EOL> def test_download_object_invalid_file_size ( self ) : <EOL> CloudFilesMockRawResponse . type = '<STR_LIT>' <EOL> container = Container ( name = '<STR_LIT>' , extra = { } , driver = self ) <EOL> obj = Object ( name = '<STR_LIT>' , size = <NUM_LIT:1000> , hash = None , extra = { } , <EOL> container = container , meta_data = None , <EOL> driver = CloudFilesStorageDriver ) <EOL> destination_path = os . path . abspath ( __file__ ) + '<STR_LIT>' <EOL> result = self . driver . download_object ( obj = obj , <EOL> destination_path = destination_path , <EOL> overwrite_existing = False , <EOL> delete_on_failure = True ) <EOL> self . assertFalse ( result ) <EOL> def download_object_success_not_found ( self ) : <EOL> CloudFilesMockHttp . type = '<STR_LIT>' <EOL> obj = Object ( name = '<STR_LIT>' , size = <NUM_LIT:1000> , hash = None , extra = { } , <EOL> container = container , meta_data = None , <EOL> driver = CloudFilesStorageDriver ) <EOL> destination_path = os . path . abspath ( __file__ ) <EOL> try : <EOL> result = self . driver . download_object ( obj = obj , <EOL> destination_path = destination_path , <EOL> overwrite_existing = False , <EOL> delete_on_failure = True ) <EOL> except ObjectDoesNotExistError : <EOL> pass <EOL> else : <EOL> self . fail ( '<STR_LIT>' ) <EOL> def object_as_stream ( self ) : <EOL> pass <EOL> def test_upload_object_success ( self ) : <EOL> def upload_file ( self , response , file_path , chunked = False , <EOL> calculate_hash = True ) : <EOL> return True , '<STR_LIT>' , <NUM_LIT:1000> <EOL> old_func = CloudFilesStorageDriver . _upload_file <EOL> CloudFilesStorageDriver . _upload_file = upload_file <EOL> file_path = os . path . abspath ( __file__ ) <EOL> container = Container ( name = '<STR_LIT>' , extra = { } , driver = self ) <EOL> object_name = '<STR_LIT>' <EOL> obj = self . driver . upload_object ( file_path = file_path , container = container , <EOL> object_name = object_name ) <EOL> self . assertEqual ( obj . name , '<STR_LIT>' ) <EOL> self . assertEqual ( obj . size , <NUM_LIT:1000> ) <EOL> CloudFilesStorageDriver . _upload_file = old_func <EOL> def test_upload_object_invalid_hash ( self ) : <EOL> def upload_file ( self , response , file_path , chunked = False , <EOL> calculate_hash = True ) : <EOL> return True , '<STR_LIT>' , <NUM_LIT:1000> <EOL> CloudFilesMockRawResponse . type = '<STR_LIT>' <EOL> old_func = CloudFilesStorageDriver . _upload_file <EOL> CloudFilesStorageDriver . _upload_file = upload_file <EOL> file_path = os . path . abspath ( __file__ ) <EOL> container = Container ( name = '<STR_LIT>' , extra = { } , driver = self ) <EOL> object_name = '<STR_LIT>' <EOL> try : <EOL> obj = self . driver . upload_object ( file_path = file_path , container = container , <EOL> object_name = object_name , <EOL> file_hash = '<STR_LIT>' ) <EOL> except ObjectHashMismatchError : <EOL> pass <EOL> else : <EOL> self . fail ( '<STR_LIT>' ) <EOL> finally : <EOL> CloudFilesStorageDriver . _upload_file = old_func <EOL> def test_upload_object_no_content_type ( self ) : <EOL> def no_content_type ( name ) : <EOL> return None , None <EOL> old_func = libcloud . utils . guess_file_mime_type <EOL> libcloud . utils . guess_file_mime_type = no_content_type <EOL> file_path = os . path . abspath ( __file__ ) <EOL> container = Container ( name = '<STR_LIT>' , extra = { } , driver = self ) <EOL> object_name = '<STR_LIT>' <EOL> try : <EOL> obj = self . driver . upload_object ( file_path = file_path , container = container , <EOL> object_name = object_name ) <EOL> except AttributeError : <EOL> pass <EOL> else : <EOL> self . fail ( '<STR_LIT>' ) <EOL> finally : <EOL> libcloud . utils . guess_file_mime_type = old_func <EOL> def test_upload_object_error ( self ) : <EOL> def dummy_content_type ( name ) : <EOL> return '<STR_LIT>' , None <EOL> def send ( instance ) : <EOL> raise Exception ( '<STR_LIT>' ) <EOL> old_func1 = libcloud . utils . guess_file_mime_type <EOL> libcloud . utils . guess_file_mime_type = dummy_content_type <EOL> old_func2 = CloudFilesMockHttp . send <EOL> CloudFilesMockHttp . send = send <EOL> file_path = os . path . abspath ( __file__ ) <EOL> container = Container ( name = '<STR_LIT>' , extra = { } , driver = self ) <EOL> object_name = '<STR_LIT>' <EOL> try : <EOL> obj = self . driver . upload_object ( file_path = file_path , container = container , <EOL> object_name = object_name ) <EOL> except LibcloudError : <EOL> pass <EOL> else : <EOL> self . fail ( '<STR_LIT>' ) <EOL> finally : <EOL> libcloud . utils . guess_file_mime_type = old_func1 <EOL> CloudFilesMockHttp . send = old_func2 <EOL> def test_upload_object_inexistent_file ( self ) : <EOL> def dummy_content_type ( name ) : <EOL> return '<STR_LIT>' , None <EOL> old_func = libcloud . utils . guess_file_mime_type <EOL> libcloud . utils . guess_file_mime_type = dummy_content_type <EOL> file_path = os . path . abspath ( __file__ + '<STR_LIT>' ) <EOL> container = Container ( name = '<STR_LIT>' , extra = { } , driver = self ) <EOL> object_name = '<STR_LIT>' <EOL> try : <EOL> obj = self . driver . upload_object ( file_path = file_path , container = container , <EOL> object_name = object_name ) <EOL> except OSError : <EOL> pass <EOL> else : <EOL> self . fail ( '<STR_LIT>' ) <EOL> finally : <EOL> libcloud . utils . guess_file_mime_type = old_func <EOL> def test_upload_object_via_stream ( self ) : <EOL> def dummy_content_type ( name ) : <EOL> return '<STR_LIT>' , None <EOL> old_func = libcloud . utils . guess_file_mime_type <EOL> libcloud . utils . guess_file_mime_type = dummy_content_type <EOL> container = Container ( name = '<STR_LIT>' , extra = { } , driver = self ) <EOL> object_name = '<STR_LIT>' <EOL> iterator = DummyIterator ( data = [ '<STR_LIT:2>' , '<STR_LIT:3>' , '<STR_LIT:5>' ] ) <EOL> try : <EOL> obj = self . driver . upload_object_via_stream ( container = container , <EOL> object_name = object_name , <EOL> iterator = iterator ) <EOL> finally : <EOL> libcloud . utils . guess_file_mime_type = old_func <EOL> def test_delete_object_success ( self ) : <EOL> container = Container ( name = '<STR_LIT>' , extra = { } , driver = self ) <EOL> obj = Object ( name = '<STR_LIT>' , size = <NUM_LIT:1000> , hash = None , extra = { } , <EOL> container = container , meta_data = None , <EOL> driver = CloudFilesStorageDriver ) <EOL> result = self . driver . delete_object ( obj = obj ) <EOL> self . assertTrue ( result ) <EOL> def test_delete_object_success ( self ) : <EOL> CloudFilesMockHttp . type = '<STR_LIT>' <EOL> container = Container ( name = '<STR_LIT>' , extra = { } , driver = self ) <EOL> obj = Object ( name = '<STR_LIT>' , size = <NUM_LIT:1000> , hash = None , extra = { } , <EOL> container = container , meta_data = None , <EOL> driver = CloudFilesStorageDriver ) <EOL> try : <EOL> result = self . driver . delete_object ( obj = obj ) <EOL> except ObjectDoesNotExistError : <EOL> pass <EOL> else : <EOL> self . fail ( '<STR_LIT>' ) <EOL> def _remove_test_file ( self ) : <EOL> file_path = os . path . abspath ( __file__ ) + '<STR_LIT>' <EOL> try : <EOL> os . unlink ( file_path ) <EOL> except OSError : <EOL> pass <EOL> class CloudFilesMockHttp ( MockHttp ) : <EOL> fixtures = StorageFileFixtures ( '<STR_LIT>' ) <EOL> base_headers = { '<STR_LIT>' : '<STR_LIT>' } <EOL> def putrequest ( self , method , action ) : <EOL> pass <EOL> def putheader ( self , key , value ) : <EOL> pass <EOL> def endheaders ( self ) : <EOL> pass <EOL> def send ( self , data ) : <EOL> pass <EOL> def _v1_0 ( self , method , url , body , headers ) : <EOL> headers = copy . deepcopy ( self . base_headers ) <EOL> headers . update ( { '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' } ) <EOL> return ( httplib . NO_CONTENT , "<STR_LIT>" , headers , httplib . responses [ httplib . NO_CONTENT ] ) <EOL> def _v1_MossoCloudFS_EMPTY ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> return ( httplib . OK , body , self . base_headers , httplib . responses [ httplib . OK ] ) <EOL> def _v1_MossoCloudFS ( self , method , url , body , headers ) : <EOL> if method == '<STR_LIT:GET>' : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> status_code = httplib . OK <EOL> headers = copy . deepcopy ( self . base_headers ) <EOL> elif method == '<STR_LIT>' : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> status_code = httplib . NO_CONTENT <EOL> headers = copy . deepcopy ( self . base_headers ) <EOL> headers . update ( { '<STR_LIT>' : <NUM_LIT:10> , <EOL> '<STR_LIT>' : <NUM_LIT> , <EOL> '<STR_LIT>' : <NUM_LIT> <EOL> } ) <EOL> return ( status_code , body , headers , httplib . responses [ httplib . OK ] ) <EOL> def _v1_MossoCloudFS_test_container_EMPTY ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> return ( httplib . OK , body , self . base_headers , httplib . responses [ httplib . OK ] ) <EOL> def _v1_MossoCloudFS_test_container ( self , method , url , body , headers ) : <EOL> if method == '<STR_LIT:GET>' : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> status_code = httplib . OK <EOL> headers = copy . deepcopy ( self . base_headers ) <EOL> elif method == '<STR_LIT>' : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> status_code = httplib . NO_CONTENT <EOL> headers = copy . deepcopy ( self . base_headers ) <EOL> headers . update ( { '<STR_LIT>' : <NUM_LIT> , <EOL> '<STR_LIT>' : <NUM_LIT> <EOL> } ) <EOL> return ( status_code , body , headers , httplib . responses [ httplib . OK ] ) <EOL> def _v1_MossoCloudFS_test_container_test_object ( self , method , url , body , <EOL> headers ) : <EOL> if method == '<STR_LIT>' : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> status_code = httplib . NO_CONTENT <EOL> headers = self . base_headers <EOL> headers . update ( { '<STR_LIT>' : <NUM_LIT> , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' } ) <EOL> return ( status_code , body , headers , httplib . responses [ httplib . OK ] ) <EOL> def _v1_MossoCloudFS_test_create_container ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> headers = self . base_headers <EOL> headers . update ( { '<STR_LIT>' : <NUM_LIT> , <EOL> '<STR_LIT:date>' : '<STR_LIT>' <EOL> } ) <EOL> status_code = httplib . CREATED <EOL> return ( status_code , body , headers , httplib . responses [ httplib . OK ] ) <EOL> def _v1_MossoCloudFS_test_create_container_ALREADY_EXISTS ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> headers = self . base_headers <EOL> headers . update ( { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> status_code = httplib . ACCEPTED <EOL> return ( status_code , body , headers , httplib . responses [ httplib . OK ] ) <EOL> def _v1_MossoCloudFS_foo_bar_container ( self , method , url , body , headers ) : <EOL> if method == '<STR_LIT>' : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> headers = self . base_headers <EOL> status_code = httplib . NO_CONTENT <EOL> return ( status_code , body , headers , httplib . responses [ httplib . OK ] ) <EOL> def _v1_MossoCloudFS_foo_bar_container_NOT_FOUND ( self , method , url , body , headers ) : <EOL> if method == '<STR_LIT>' : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> headers = self . base_headers <EOL> status_code = httplib . NOT_FOUND <EOL> return ( status_code , body , headers , httplib . responses [ httplib . OK ] ) <EOL> def _v1_MossoCloudFS_foo_bar_container_NOT_EMPTY ( self , method , url , body , headers ) : <EOL> if method == '<STR_LIT>' : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> headers = self . base_headers <EOL> status_code = httplib . CONFLICT <EOL> return ( status_code , body , headers , httplib . responses [ httplib . OK ] ) <EOL> def _v1_MossoCloudFS_foo_bar_container_foo_bar_object ( self , method , url , body , headers ) : <EOL> if method == '<STR_LIT>' : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> headers = self . base_headers <EOL> status_code = httplib . NO_CONTENT <EOL> return ( status_code , body , headers , httplib . responses [ httplib . OK ] ) <EOL> def _v1_MossoCloudFS_foo_bar_container_foo_bar_object_NOT_FOUND ( self , method , url , body , headers ) : <EOL> if method == '<STR_LIT>' : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> headers = self . base_headers <EOL> status_code = httplib . NOT_FOUND <EOL> return ( status_code , body , headers , httplib . responses [ httplib . OK ] ) <EOL> class CloudFilesMockRawResponse ( MockRawResponse ) : <EOL> fixtures = StorageFileFixtures ( '<STR_LIT>' ) <EOL> base_headers = { '<STR_LIT>' : '<STR_LIT>' } <EOL> def __init__ ( self , * args , ** kwargs ) : <EOL> super ( CloudFilesMockRawResponse , self ) . __init__ ( * args , ** kwargs ) <EOL> self . _data = [ ] <EOL> self . _current_item = <NUM_LIT:0> <EOL> def next ( self ) : <EOL> if self . _current_item == len ( self . _data ) : <EOL> raise StopIteration <EOL> value = self . _data [ self . _current_item ] <EOL> self . _current_item += <NUM_LIT:1> <EOL> return value <EOL> def _generate_random_data ( self , size ) : <EOL> data = [ ] <EOL> current_size = <NUM_LIT:0> <EOL> while current_size < size : <EOL> value = str ( random . randint ( <NUM_LIT:0> , <NUM_LIT:9> ) ) <EOL> value_size = len ( value ) <EOL> data . append ( value ) <EOL> current_size += value_size <EOL> return data <EOL> def _v1_MossoCloudFS_foo_bar_container_foo_test_upload ( self , method , url , body , headers ) : <EOL> body = '<STR_LIT>' <EOL> header = copy . deepcopy ( self . base_headers ) <EOL> return ( httplib . CREATED , body , headers , httplib . responses [ httplib . OK ] ) <EOL> def _v1_MossoCloudFS_foo_bar_container_foo_test_upload_INVALID_HASH ( self , method , url , body , headers ) : <EOL> body = '<STR_LIT>' <EOL> headers = self . base_headers <EOL> return ( httplib . UNPROCESSABLE_ENTITY , body , headers , <EOL> httplib . responses [ httplib . OK ] ) <EOL> def _v1_MossoCloudFS_foo_bar_container_foo_bar_object ( self , method , url , body , headers ) : <EOL> body = '<STR_LIT:test>' <EOL> self . _data = self . _generate_random_data ( <NUM_LIT:1000> ) <EOL> return ( httplib . OK , body , self . base_headers , httplib . responses [ httplib . OK ] ) <EOL> def _v1_MossoCloudFS_foo_bar_container_foo_bar_object_INVALID_SIZE ( self , method , url , body , headers ) : <EOL> body = '<STR_LIT:test>' <EOL> self . _data = self . _generate_random_data ( <NUM_LIT:100> ) <EOL> return ( httplib . OK , body , self . base_headers , httplib . responses [ httplib . OK ] ) <EOL> def _v1_MossoCloudFS_foo_bar_container_foo_test_stream_data ( self , method , url , body , headers ) : <EOL> body = '<STR_LIT:test>' <EOL> return ( httplib . OK , body , self . base_headers , httplib . responses [ httplib . OK ] ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> sys . exit ( unittest . main ( ) ) </s>
