Beispiel #1
0
 def delete_endpoint(id):
     code = CRUD.deleteEndpoint(id, commit=True)
     if code == 0:
         return {
             'status':
             'error',
             'message':
             'Endpoint #%d was not found. Maybe it was alredy deleted' % id,
             'id':
             id
         }
     elif code == -1:
         return {
             'status':
             'error',
             'message':
             'Oooops! Something went wrong while deleting Endpoint #%d' %
             id,
             'id':
             id
         }
     elif code > 0:
         return {
             'status': 'ok',
             'message': 'endpoint #%d was successfully deleted' % id,
             'id': id
         }
Beispiel #2
0
def test_delete_endpoint_by_id(mock_crud, context_endpoint):
    print('\n=> Testing deleting endpoint by id')
    code = CRUD.deleteEndpoint(context_endpoint.get('endpoint_id'))
    assert code>0