本文整理汇总了Python中sahara.service.validations.edp.data_source.check_data_source_create函数的典型用法代码示例。如果您正苦于以下问题:Python check_data_source_create函数的具体用法?Python check_data_source_create怎么用?Python check_data_source_create使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了check_data_source_create函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_hdfs_creation_local_abs_url
def test_hdfs_creation_local_abs_url(self, check_data_source_unique_name):
check_data_source_unique_name.return_value = True
data = {
"name": "test_data_data_source",
"url": "/tmp/output",
"type": "hdfs",
"description": "correct url schema for absolute path on local hdfs"
}
ds.check_data_source_create(data)
示例2: test_hdfs_creation_local_rel_url
def test_hdfs_creation_local_rel_url(self, check_data_source_unique_name):
check_data_source_unique_name.return_value = True
data = {
"name": "test_data_data_source",
"url": "mydata/input",
"type": "hdfs",
"description": "correct url schema for relative path on local hdfs"
}
ds.check_data_source_create(data)
示例3: test_hdfs_creation_correct_url
def test_hdfs_creation_correct_url(self, check_data_source_unique_name):
check_data_source_unique_name.return_value = True
data = {
"name": "test_data_data_source",
"url": "hdfs://test_cluster/",
"type": "hdfs",
"description": "correct url schema"
}
ds.check_data_source_create(data)
示例4: test_manila_creation_empty_url
def test_manila_creation_empty_url(self, check_ds_unique_name):
check_ds_unique_name.return_value = True
data = {
"name": "test_data_data_source",
"url": "",
"type": "manila",
"description": ("empty url")
}
with testtools.ExpectedException(ex.InvalidDataException):
ds.check_data_source_create(data)
示例5: test_manila_creation_no_path
def test_manila_creation_no_path(self, check_ds_unique_name):
check_ds_unique_name.return_value = True
data = {
"name": "test_data_data_source",
"url": "manila://%s" % uuid.uuid4(),
"type": "manila",
"description": ("netloc is not a uuid")
}
with testtools.ExpectedException(ex.InvalidDataException):
ds.check_data_source_create(data)
示例6: test_manila_creation_wrong_schema
def test_manila_creation_wrong_schema(self, check_ds_unique_name):
check_ds_unique_name.return_value = True
data = {
"name": "test_data_data_source",
"url": "man://%s" % uuid.uuid4(),
"type": "manila",
"description": ("incorrect url schema for")
}
with testtools.ExpectedException(ex.InvalidDataException):
ds.check_data_source_create(data)
示例7: test_hdfs_creation_wrong_schema
def test_hdfs_creation_wrong_schema(self, check_data_source_unique_name):
check_data_source_unique_name.return_value = True
data = {
"name": "test_data_data_source",
"url": "hdf://test_cluster/",
"type": "hdfs",
"description": "incorrect url schema"
}
with self.assertRaises(ex.InvalidException):
ds.check_data_source_create(data)
示例8: test_maprfs_creation_wrong_schema
def test_maprfs_creation_wrong_schema(self, check_data_source_unique_name):
check_data_source_unique_name.return_value = True
data = {
"name": "test_data_data_source",
"url": "maprf://test_cluster/",
"type": "maprfs",
"description": "incorrect url schema"
}
with testtools.ExpectedException(ex.InvalidException):
ds.check_data_source_create(data)
示例9: test_swift_creation_wrong_schema
def test_swift_creation_wrong_schema(self, check_data_source_unique_name):
check_data_source_unique_name.return_value = True
data = {
"name": "test_data_data_source",
"url": "swif://1234/object",
"type": "swift",
"description": "incorrect url schema"
}
with testtools.ExpectedException(ex.InvalidDataException):
ds.check_data_source_create(data)
示例10: test_swift_creation_missing_credentials
def test_swift_creation_missing_credentials(self, check_data_source_unique_name):
check_data_source_unique_name.return_value = True
data = {
"name": "test_data_data_source",
"url": SAMPLE_SWIFT_URL,
"type": "swift",
"description": "long description",
}
with testtools.ExpectedException(ex.InvalidCredentials):
ds.check_data_source_create(data)
示例11: test_swift_creation_wrong_schema
def test_swift_creation_wrong_schema(self, check_data_source_unique_name):
check_data_source_unique_name.return_value = True
data = {
"name": "test_data_data_source",
"url": "swif://1234%s/object" % su.SWIFT_URL_SUFFIX,
"type": "swift",
"description": "incorrect url schema"
}
with self.assertRaises(ex.InvalidException):
ds.check_data_source_create(data)
示例12: test_swift_creation_missing_object
def test_swift_creation_missing_object(self,
check_data_source_unique_name):
check_data_source_unique_name.return_value = True
data = {
"name": "test_data_data_source",
"url": "swift://1234/",
"type": "swift",
"description": "incorrect url schema"
}
with self.assertRaises(ex.InvalidException):
ds.check_data_source_create(data)
示例13: test_swift_creation_missing_credentials
def test_swift_creation_missing_credentials(self,
check_data_source_unique_name):
check_data_source_unique_name.return_value = True
data = {
"name": "test_data_data_source",
"url": "swift://1234",
"type": "swift",
"description": "long description"
}
with self.assertRaises(ex.InvalidCredentials):
ds.check_data_source_create(data)
示例14: test_swift_creation_missing_credentials
def test_swift_creation_missing_credentials(self,
check_data_source_unique_name):
check_data_source_unique_name.return_value = True
data = {
"name": "test_data_data_source",
"url": SAMPLE_SWIFT_URL,
"type": "swift",
"description": "long description"
}
with testtools.ExpectedException(ex.InvalidCredentials):
ds.check_data_source_create(data)
# proxy enabled should allow creation without credentials
self.override_config('use_domain_for_proxy_users', True)
ds.check_data_source_create(data)
示例15: test_swift_creation_credentials_missing_password
def test_swift_creation_credentials_missing_password(
self,
check_data_source_unique_name):
check_data_source_unique_name.return_value = True
data = {
"name": "test_data_data_source",
"url": SAMPLE_SWIFT_URL,
"type": "swift",
"credentials": {
"user": "user",
},
"description": "long description"
}
with self.assertRaises(ex.InvalidCredentials):
ds.check_data_source_create(data)