"Incorrect extraction of metadata for file {0}".format(test_file_path)
assert"triggers_specification_errors"notinclmc_service_response,"Unexpected error was returned for triggers specification"
assert"triggers_action_errors"notinclmc_service_response,"Unexpected error was returned for handlers specification"
# traverse through all alert IDs and check that they are created within Kapacitor
foralert_idinalert_ids:
...
...
@@ -192,6 +194,17 @@ class TestAlertsConfigurationAPI(object):
assertkapacitor_response_json["kind"]=="post","Incorrect kind of handler {0} in the Kapacitor response - test file {1}".format(handler_id,test_file_path)
assertkapacitor_response_json["options"]["url"],"Incorrect url of handler {0} in the Kapacitor response - test file {1}".format(handler_id,test_file_path)
# send the same spec again to check that error messages are returned (because of ID duplication)
withopen(alert_spec_abs_path)asalert_spec:
request.POST['alert-spec']=FieldStorageMock(test_file_path,alert_spec)# a simple mock class is used to mimic the FieldStorage class