Commit eeacf205 authored by Romain Courteaud's avatar Romain Courteaud

slapos_crm: update tests

parent 11c94d96
portal = context.getPortalObject()
portal.portal_catalog.searchAndActivate(
portal_type="Regularisation Request",
portal_type="Regularisation Request",
simulation_state=["suspended"],
default_resource_uid=portal.service_module.slapos_crm_acknowledgement.getUid(),
resource__uid=portal.service_module.slapos_crm_acknowledgement.getUid(),
method_id='RegularisationRequest_triggerAcknowledgmentEscalation',
activate_kw={'tag': tag}
)
......
portal = context.getPortalObject()
portal.portal_catalog.searchAndActivate(
portal_type="Regularisation Request",
portal_type="Regularisation Request",
simulation_state=["suspended"],
default_resource_uid=portal.service_module.slapos_crm_stop_reminder.getUid(),
resource__uid=portal.service_module.slapos_crm_stop_reminder.getUid(),
method_id='RegularisationRequest_triggerStopReminderEscalation',
activate_kw={'tag': tag}
)
......
......@@ -212,7 +212,10 @@ class TestSlapOSCrmTriggerEscalationOnAcknowledgmentRegularisationRequest(SlapOS
reference="TESTREGREQ-%s" % new_id,
)
def test_triggerAcknowledgmentEscalation_matching_regularisation_request(self):
#################################################################
# slapos_crm_trigger_acknowledgment_escalation
#################################################################
def test_RegularisationRequest_triggerAcknowledgmentEscalation_alarm_matchingRegularisationRequest(self):
ticket = self.createRegularisationRequest()
ticket.edit(resource='service_module/slapos_crm_acknowledgement')
ticket.validate()
......@@ -224,7 +227,7 @@ class TestSlapOSCrmTriggerEscalationOnAcknowledgmentRegularisationRequest(SlapOS
self._test_alarm(alarm, ticket,
"RegularisationRequest_triggerAcknowledgmentEscalation")
def test_triggerAcknowledgmentEscalation_not_suspended(self):
def test_RegularisationRequest_triggerAcknowledgmentEscalation_alarm_notSuspendedRegularisationRequest(self):
ticket = self.createRegularisationRequest()
ticket.edit(resource='service_module/slapos_crm_acknowledgement')
ticket.validate()
......@@ -236,7 +239,7 @@ class TestSlapOSCrmTriggerEscalationOnAcknowledgmentRegularisationRequest(SlapOS
"RegularisationRequest_triggerAcknowledgmentEscalation")
def test_triggerAcknowledgmentEscalation_not_expected_resource(self):
def test_RegularisationRequest_triggerAcknowledgmentEscalation_alarm__notExpectedResource(self):
ticket = self.createRegularisationRequest()
ticket.validate()
ticket.suspend()
......@@ -247,6 +250,7 @@ class TestSlapOSCrmTriggerEscalationOnAcknowledgmentRegularisationRequest(SlapOS
self._test_alarm_not_visited(alarm, ticket,
"RegularisationRequest_triggerAcknowledgmentEscalation")
class TestSlapOSCrmTriggerEscalationOnStopReminderRegularisationRequest(SlapOSTestCaseMixinWithAbort):
def createRegularisationRequest(self):
......@@ -257,7 +261,10 @@ class TestSlapOSCrmTriggerEscalationOnStopReminderRegularisationRequest(SlapOSTe
reference="TESTREGREQ-%s" % new_id,
)
def test_triggerStopReminderEscalation_matching_regularisation_request(self):
#################################################################
# slapos_crm_trigger_stop_reminder_escalation
#################################################################
def test_RegularisationRequest_triggerStopReminderEscalation_alarm_matchingRegularisationRequest(self):
ticket = self.createRegularisationRequest()
ticket.edit(resource='service_module/slapos_crm_stop_reminder')
ticket.validate()
......@@ -269,7 +276,7 @@ class TestSlapOSCrmTriggerEscalationOnStopReminderRegularisationRequest(SlapOSTe
self._test_alarm(alarm, ticket,
"RegularisationRequest_triggerStopReminderEscalation")
def test_triggerStopReminderEscalation_not_suspended(self):
def test_RegularisationRequest_triggerStopReminderEscalation_alarm_notSuspended(self):
ticket = self.createRegularisationRequest()
ticket.edit(resource='service_module/slapos_crm_stop_reminder')
ticket.validate()
......@@ -280,7 +287,7 @@ class TestSlapOSCrmTriggerEscalationOnStopReminderRegularisationRequest(SlapOSTe
self._test_alarm_not_visited(alarm, ticket,
"RegularisationRequest_triggerStopReminderEscalation")
def test_triggerStopReminderEscalation_not_expected_resource(self):
def test_RegularisationRequest_triggerStopReminderEscalation_alarm_notExpectedResource(self):
ticket = self.createRegularisationRequest()
ticket.validate()
ticket.suspend()
......@@ -291,6 +298,7 @@ class TestSlapOSCrmTriggerEscalationOnStopReminderRegularisationRequest(SlapOSTe
self._test_alarm_not_visited(alarm, ticket,
"RegularisationRequest_triggerStopReminderEscalation")
class TestSlapOSCrmTriggerEscalationOnStopAcknowledgmentRegularisationRequest(SlapOSTestCaseMixinWithAbort):
def createRegularisationRequest(self):
......@@ -301,6 +309,9 @@ class TestSlapOSCrmTriggerEscalationOnStopAcknowledgmentRegularisationRequest(Sl
reference="TESTREGREQ-%s" % new_id,
)
#################################################################
# slapos_crm_trigger_stop_acknowledgment_escalation
#################################################################
def test_triggerStopAcknowledgmentEscalation_matching_regularisation_request(self):
ticket = self.createRegularisationRequest()
ticket.edit(resource='service_module/slapos_crm_stop_acknowledgement')
......@@ -345,7 +356,10 @@ class TestSlapOSCrmTriggerEscalationOnDeleteReminderRegularisationRequest(SlapOS
reference="TESTREGREQ-%s" % new_id,
)
def test_triggerDeleteReminderEscalation_matching_regularisation_request(self):
#################################################################
# slapos_crm_trigger_delete_reminder_escalation
#################################################################
def test_RegularisationRequest_triggerDeleteReminderEscalation_alarm_matchingRegularisationRequest(self):
ticket = self.createRegularisationRequest()
ticket.edit(resource='service_module/slapos_crm_delete_reminder')
ticket.validate()
......@@ -356,18 +370,17 @@ class TestSlapOSCrmTriggerEscalationOnDeleteReminderRegularisationRequest(SlapOS
slapos_crm_trigger_delete_reminder_escalation
self._test_alarm(alarm, ticket, "RegularisationRequest_triggerDeleteReminderEscalation")
def test_triggerDeleteReminderEscalation_not_suspended(self):
def test_RegularisationRequest_triggerDeleteReminderEscalation_alarm_notSuspended(self):
ticket = self.createRegularisationRequest()
ticket.edit(resource='service_module/slapos_crm_delete_reminder')
ticket.validate()
self.tic()
self.tic()
alarm = self.portal.portal_alarms.\
slapos_crm_trigger_delete_reminder_escalation
self._test_alarm_not_visited(alarm, ticket, "RegularisationRequest_triggerDeleteReminderEscalation")
def test_triggerDeleteReminderEscalation_not_expected_resource(self):
def test_RegularisationRequest_triggerDeleteReminderEscalation_alarm_notExpectedResource(self):
ticket = self.createRegularisationRequest()
ticket.validate()
ticket.suspend()
......@@ -377,6 +390,7 @@ class TestSlapOSCrmTriggerEscalationOnDeleteReminderRegularisationRequest(SlapOS
slapos_crm_trigger_delete_reminder_escalation
self._test_alarm_not_visited(alarm, ticket, "RegularisationRequest_triggerDeleteReminderEscalation")
class TestSlapOSCrmStopInstanceTree(SlapOSTestCaseMixinWithAbort):
def createRegularisationRequest(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment