Giter VIP home page Giter VIP logo

Comments (5)

scossu avatar scossu commented on June 26, 2024 1

Tests for the Prefer header are here.

from lakesuperior.

whikloj avatar whikloj commented on June 26, 2024

So I was looking at this one here. But it seems like you only apply certain headers, certain ways.

I'm still really unclear how this all works together (haven't got debugging in pycharm setup). But you probably need to account for both include and omit for all possible Preferences.

See https://jira.duraspace.org/projects/FCREPO/issues/FCREPO-3037 for an example of how we didn't account for this. I'll just try to account for the Preferences you are handling for now and it can be expanded later.

from lakesuperior.

scossu avatar scossu commented on June 26, 2024

That function gets some "include/omit" values from parse_rfc7240 in https://github.com/scossu/lakesuperior/blob/master/lakesuperior/util/toolbox.py#L75 and sets some defaults based on whether representation=minimal is set. Then it flips some defaults based on certain "include" and "omit" conditions. I am not checking for conditions that would not change the existing default. I may have not written extensive testing but I believe this is meant to cover all combinations; unless you are referring to conditions that I am not aware of (note that I wrote this server based on the Fedora 4 REST API documentation).

The simplest and most efficient way to debug requests for me is to add import pdb; pdb.set_trace() where you want a breakpoint, then fire up lsup-server (the blocking Flask app, not the WSGI server that may time out if you hold up a request) in one shell and send an HTTP request in another, then follow the execution with pdb commands.

from lakesuperior.

whikloj avatar whikloj commented on June 26, 2024

How or from where do I run the test suite?

from lakesuperior.

scossu avatar scossu commented on June 26, 2024

From the git repo root: pytest

Or pytest -x to quit on first failure.

from lakesuperior.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.