'Creates OperationContract for deleteServerGroup.
To verify the operation, we just check that the AWS Auto Scaling Group
is no longer visible on AWS (or is in the process of terminating).'

def delete_server_group(self):

    bindings = self.bindings
    group_name = '{app}-{stack}-v000'.format(app=self.TEST_APP, stack=bindings['TEST_STACK'])
    payload = self.agent.make_json_payload_from_kwargs(job=[{'cloudProvider': 'aws', 'type': 'destroyServerGroup', 'serverGroupName': group_name, 'asgName': group_name, 'region': bindings['TEST_AWS_REGION'], 'regions': [bindings['TEST_AWS_REGION']], 'credentials': bindings['SPINNAKER_AWS_ACCOUNT'], 'user': '[anonymous]'}], application=self.TEST_APP, description=('DestroyServerGroup:    ' + group_name))
    builder = aws.AwsPythonContractBuilder(self.aws_observer)
    builder.new_clause_builder('Auto    Scaling    Group    Removed').call_method(self.autoscaling_client.describe_auto_scaling_groups, AutoScalingGroupNames=[group_name]).EXPECT(ov_factory.error_list_contains(jp.ExceptionMatchesPredicate((BotoCoreError, ClientError), 'AutoScalingGroupNotFound'))).OR(ov_factory.value_list_path_contains('AutoScalingGroups', jp.LIST_MATCHES([jp.DICT_MATCHES({'Status': jp.STR_SUBSTR('Delete'), 'MaxSize': jp.NUM_EQ(0)})])))
    return st.OperationContract(self.new_post_operation(title='delete_server_group', data=payload, path='tasks'), contract=builder.build())
