本文整理汇总了Python中RappCloud.RappCloud.available_services方法的典型用法代码示例。如果您正苦于以下问题:Python RappCloud.available_services方法的具体用法?Python RappCloud.available_services怎么用?Python RappCloud.available_services使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RappCloud.RappCloud
的用法示例。
在下文中一共展示了RappCloud.available_services方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from RappCloud import RappCloud [as 别名]
# 或者: from RappCloud.RappCloud import available_services [as 别名]
class RappInterfaceTest:
def __init__(self):
self.rappCloud = RappCloud()
# Set the valid results
self.valid_results = [
u'ontology_subclasses_of',
u'available_services',
u'qr_detection',
u'speech_detection_sphinx4',
u'speech_detection_google',
u'ontology_is_subsuperclass_of',
u'face_detection',
u'set_denoise_profile',
u'ontology_superclasses_of',
u'record_cognitive_test_performance',
u'cognitive_test_chooser',
u'text_to_speech'
]
def execute(self):
start_time = timeit.default_timer()
# Call the Python RappCloud service
response = self.rappCloud.available_services()
end_time = timeit.default_timer()
self.elapsed_time = end_time - start_time
return self.validate(response)
def validate(self, response):
# Get the returned data
error = response['error']
if error != "":
return [error, self.elapsed_time]
return_data = response['services']
# Check if the returned data are equal to the expected
for ser in self.valid_results:
if ser not in return_data:
return ["Unexpected result : " + str(return_data), self.elapsed_time]
return [True, self.elapsed_time]