def testCreateS3Source(self):
        """
        Test the minerva S3 source create API endpoint.
        """

        path = '/minerva_source_s3'
        name = 'nasanex'
        prefix = '/dontimportanythingplease'
        bucket = 'nasanex'
        params = {
            'name': name,
            'bucket': bucket,
            'prefix': prefix,
            'accessKeyId': '',
            'secret': '',
            'service': '',
            'readOnly': True
        }

        response = self.request(path=path, method='POST', params=params, user=self._user)
        self.assertStatusOk(response)
        source = response.json

        self.assertEquals(source['name'], name, 'incorrect source name')
        minerva_metadata = source['meta']['minerva']
        self.assertEquals(minerva_metadata['prefix'], prefix, 'Expected %s as prefix' % prefix)
        self.assertEquals(minerva_metadata['source_type'], 's3', 'Expected s3 source_type')
        self.assertEquals(minerva_metadata['bucket'], bucket, 'Expected s3 source bucket %s' % bucket)

        # Ensure the import folder has been created
        path = '/folder/%s' % str(minerva_metadata['folder_id'])
        response = self.request(path=path, method='GET', user=self._user)
        self.assertStatusOk(response)
        self.assertEquals(response.json['name'], prefix, 'Expected %s as folder name' % prefix)
dataset/ETHPy150Open Kitware/minerva/plugin_tests/s3_source_test.py/S3SourceTestCase.testCreateS3Source/original