'Creates azContract for deleteServerGroup.
To verify the operation, we just check that the spinnaker security group
for the given application was deleted.'

def delete_a_security_group(self):

    payload = self.agent.make_json_payload_from_kwargs(job=[{'Provider': 'azure', 'appName': self.bindings['TEST_APP'], 'region': self.bindings['TEST_AZURE_RG_LOCATION'], 'regions': [self.bindings['TEST_AZURE_RG_LOCATION']], 'credentials': self.bindings['SPINNAKER_AZURE_ACCOUNT'], 'securityGroupName': self.TEST_SECURITY_GROUP, 'cloudProvider': 'azure', 'type': 'deleteSecurityGroup', 'user': '[anonymous]'}], application=self.bindings['TEST_APP'], description=('Delete    Security    Group:    :    ' + self.TEST_SECURITY_GROUP))
    builder = az.AzContractBuilder(self.az_observer)
    builder.new_clause_builder('Security    Group    Deleted', retryable_for_secs=30).collect_resources(az_resource='network', command='nsg', args=['list', '--resource-group', self.TEST_SECURITY_GROUP_RG]).EXPECT(ov_factory.error_list_contains(jp.ExceptionMatchesPredicate(klass=st.CliAgentRunError, regex='(?:.*    operation:    Cannot    find    .*)|(?:.*\\(.*NotFound\\).*)'))).OR(ov_factory.value_list_path_excludes('name', jp.STR_EQ(self.TEST_SECURITY_GROUP)))
    return st.OperationContract(self.new_post_operation(title='delete_security_group', data=payload, path='applications/{app}/tasks'.format(app=self.bindings['TEST_APP'])), contract=builder.build())
