

def test_upload_object_success(self):

    def upload_file(self, response, file_path, chunked=False, calculate_hash=True):
        return (True, 'hash343hhash89h932439jsaa89', 1000)
    old_func = AtmosDriver._upload_file
    AtmosDriver._upload_file = upload_file
    path = os.path.abspath(__file__)
    container = Container(name='fbc', extra={
        
    }, driver=self)
    object_name = 'ftu'
    extra = {
        'meta_data': {
            'some-value': 'foobar',
        },
    }
    obj = self.driver.upload_object(file_path=path, container=container, extra=extra, object_name=object_name)
    self.assertEqual(obj.name, 'ftu')
    self.assertEqual(obj.size, 1000)
    self.assertTrue(('some-value' in obj.meta_data))
    AtmosDriver._upload_file = old_func

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