本文整理汇总了Python中tools.NGSI_v2.NGSI类的典型用法代码示例。如果您正苦于以下问题:Python NGSI类的具体用法?Python NGSI怎么用?Python NGSI使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了NGSI类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: verify_that_attribute_types_are_returned_in_response
def verify_that_attribute_types_are_returned_in_response(context, types):
"""
verify that entity types are returned in response
:param context: It’s a clever place where you and behave can store information to share around. It runs at three levels, automatically managed by behave.
"""
__logger__.debug("Verifying that entities types are returned from a request...")
ngsi = NGSI()
ngsi.verify_entity_types(types, context.resp)
__logger__.info("...Verified that entities types are returned from a request...")
示例2: verify_error_message
def verify_error_message(context):
"""
verify error response
:param context: parameters to evaluate. It’s a clever place where you and behave can store information to share around. It runs at three levels, automatically managed by behave.
"""
__logger__.debug("Verifying error message ...")
ngsi = NGSI()
ngsi.verify_error_response(context, context.resp)
__logger__.info("...Verified that error message is the expected")
示例3: verify_admin_error
def verify_admin_error(context, error):
"""
verify admin error message
:param context: It’s a clever place where you and behave can store information to share around. It runs at three levels, automatically managed by behave.
:param error: error message expected
"""
__logger__.debug("Verifying the admin error message: %s..." % error)
ngsi = NGSI()
ngsi.verify_admin_error(context, error)
__logger__.info("...Verified that the admin error message is the expected")
示例4: verify_that_the_attribute_is_deleted_into_mongo
def verify_that_the_attribute_is_deleted_into_mongo(context):
"""
verify that the attribute is deleted into mongo
"""
__logger__.debug("Verifying if the atribute is deleted...")
mongo = Mongo(host=props_mongo["MONGO_HOST"], port=props_mongo["MONGO_PORT"], user=props_mongo["MONGO_USER"],
password=props_mongo["MONGO_PASS"])
ngsi = NGSI()
ngsi.verify_attribute_is_deleted(mongo, context.cb.get_entity_context(), context.cb.get_headers())
__logger__.info("...verified that the attribute is deleted")
示例5: verify_get_all_entities
def verify_get_all_entities(context):
"""
verify get all entities
:param context: It’s a clever place where you and behave can store information to share around. It runs at three levels, automatically managed by behave.
"""
__logger__.debug("Verifying all entities are returned in get request...")
queries_parameters = context.cb.get_entities_parameters()
ngsi = NGSI()
ngsi.verify_get_all_entities(queries_parameters, context.entities_accumulate, context.resp)
__logger__.info("...Verified all entities are returned in get request...")
示例6: verify_that_entities_are_not_sorted_by_attributes
def verify_that_entities_are_not_sorted_by_attributes(context):
"""
verify that entities are not sorted by attributes
:param context: It’s a clever place where you and behave can store information to share around. It runs at three levels, automatically managed by behave.
"""
__logger__.debug("Verifying that entities are not sorted by attributes...")
queries_parameters = context.cb.get_entities_parameters()
ngsi = NGSI()
ngsi.verify_that_entities_are_sorted_by_some_attributes(queries_parameters, context.entities_accumulate, context.resp, False)
__logger__.debug("Verified that entities are not sorted by attributes...")
示例7: verify_error_message
def verify_error_message(context):
"""
verify error response
:param context: parameters to evaluate
"""
global cb, resp
__logger__.debug("Verifying error message ...")
ngsi = NGSI()
ngsi.verify_error_response(context, resp)
__logger__.info("...Verified that error message is the expected")
示例8: verify_that_the_attribute_value_by_id_is_returned
def verify_that_the_attribute_value_by_id_is_returned(context):
"""
verify that the attribute value by ID is returned
:param context: It’s a clever place where you and behave can store information to share around. It runs at three levels, automatically managed by behave.
"""
__logger__.debug("Verifying an attribute value by ID returned from a request...")
entities_context = context.cb.get_entity_context()
ngsi = NGSI()
ngsi.verify_an_attribute_value_by_id(entities_context, context.resp)
__logger__.info("...Verified the attribute value by ID returned from a request...")
示例9: verify_get_all_entities
def verify_get_all_entities(context):
"""
verify get all entities
"""
global cb, resp
__logger__.debug("Verifying all entities are returned in get request...")
queries_parameters = cb.get_entities_parameters()
entities_context = cb.get_entity_context()
ngsi = NGSI()
ngsi.verify_get_all_entities(queries_parameters, entities_context, resp)
__logger__.info("...Verified all entities are returned in get request...")
示例10: verify_that_the_attribute_by_ID_is_returned
def verify_that_the_attribute_by_ID_is_returned(context):
"""
verify that the attribute by ID is returned
"""
global cb, resp
__logger__.debug("Verifying an attribute by ID returned from a request...")
entities_context = cb.get_entity_context()
attribute_name_to_request = cb.get_attribute_name_to_request()
ngsi = NGSI()
ngsi.verify_an_attribute_by_id(entities_context, resp, attribute_name_to_request)
__logger__.info("...Verified an attribute by ID returned from a request...")
示例11: verify_that_an_entity_is_updated_in_mongo
def verify_that_an_entity_is_updated_in_mongo(context):
"""
verify that an entity is updated in mongo
:param context: It’s a clever place where you and behave can store information to share around. It runs at three levels, automatically managed by behave.
"""
__logger__.debug(" >> verifying that an entity is updating in mongo")
mongo = Mongo(host=props_mongo["MONGO_HOST"], port=props_mongo["MONGO_PORT"], user=props_mongo["MONGO_USER"],
password=props_mongo["MONGO_PASS"])
ngsi = NGSI()
ngsi.verify_entity_updated_in_mongo(mongo, context.cb.get_entity_context(), context.cb.get_headers())
__logger__.info(" >> verified that an entity is updated in mongo")
示例12: verify_if_the_log_level_is_the_expected
def verify_if_the_log_level_is_the_expected(context, level):
"""
verify if the log level is the expected
:param level: log level expected
:param context: It’s a clever place where you and behave can store information to share around. It runs at three levels, automatically managed by behave.
"""
__logger__.debug("Verifying if the log level \"%s\" is the expected in response..." % level)
ngsi = NGSI()
ngsi.verify_log_level(context, level)
__logger__.info("...Verified log level in response")
示例13: verify_an_attribute_by_id_in_raw_mode_from_http_response
def verify_an_attribute_by_id_in_raw_mode_from_http_response(context, field_type):
"""
verify an attribute by ID in raw mode with type in attribute value from http response
:param context: It’s a clever place where you and behave can store information to share around. It runs at three levels, automatically managed by behave.
:param field_type: field type to verify (bool | int | float | list | dict | str | NoneType)
"""
__logger__.debug("Verifying an attribute by ID returned in raw mode from http response...")
entities_context = context.cb.get_entity_context()
attribute_name_to_request = context.cb.get_attribute_name_to_request()
ngsi = NGSI()
ngsi.verify_an_attribute_by_id_in_raw_mode_http_response(entities_context, context.resp, attribute_name_to_request, field_type)
__logger__.info("...Verified an attribute by ID returned in raw mode from http response...")
示例14: verify_that_the_entity_by_id_is_returned
def verify_that_the_entity_by_id_is_returned(context):
"""
verify that the entity by ID is returned
:param context: It’s a clever place where you and behave can store information to share around. It runs at three levels, automatically managed by behave.
"""
__logger__.debug("Verifying an entity by ID returned from a request...")
queries_parameters = context.cb.get_entities_parameters()
entities_context = context.cb.get_entity_context()
entity_id_to_request = context.cb.get_entity_id_to_request()
ngsi = NGSI()
ngsi.verify_an_entity_by_id(queries_parameters, entities_context, context.resp, entity_id_to_request)
__logger__.info("...Verified an entity by ID returned from a request...")
示例15: verify_http_response_in_raw_mode_witn_type
def verify_http_response_in_raw_mode_witn_type(context, field_type):
"""
verify http response in raw mode and type in attribute value from http response
:param context: It’s a clever place where you and behave can store information to share around. It runs at three levels, automatically managed by behave.
:param field_type: field type (bool | int | float | list | dict | str | NoneType)
"""
global cb, resp
__logger__.debug("Verifying http response in raw mode from http response...")
entities_context = context.cb.get_entity_context()
ngsi = NGSI()
ngsi.verify_entity_raw_mode_http_response(entities_context, context.resp, field_type)
__logger__.info("...Verified http response in raw mode from http response...")