

def test_upload_object_via_stream_no_content_type(self):

    def no_content_type(name):
        return (None, None)
    old_func = libcloud.storage.drivers.atmos.guess_file_mime_type
    libcloud.storage.drivers.atmos.guess_file_mime_type = no_content_type
    container = Container(name='fbc', extra={
        
    }, driver=self)
    object_name = 'ftsdct'
    iterator = DummyIterator(data=['2', '3', '5'])
    try:
        self.driver.upload_object_via_stream(container=container, object_name=object_name, iterator=iterator)
    except AttributeError:
        pass
    else:
        self.fail('File content type not provided but an exception was not thrown')
    finally:
        libcloud.storage.drivers.atmos.guess_file_mime_type = old_func

dataset/ETHPy150Open apache/libcloud/libcloud/test/storage/test_atmos.py AtmosTests.test_upload_object_via_stream_no_content_type/original