Comments (5)
Tests for the Prefer
header are here.
from lakesuperior.
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.
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.
How or from where do I run the test suite?
from lakesuperior.
From the git repo root: pytest
Or pytest -x
to quit on first failure.
from lakesuperior.
Related Issues (20)
- Spec 3.3: Write test to verify HEAD headers are same as GET
- Spec 3.4: Align OPTIONS output with LDP and RFC7231
- Uncaught exceptions for `Digest` header on creation HOT 1
- Spec 3.6: change interaction model
- Spec 3.6.1: remove `handling: lenient` option HOT 1
- Spec 3.6.1: Write tests to verify that server-managed triples cannot be changed with PUT or PATCH
- Spec 3.9: reject creation of resources with external content
- Support conditional validators for LDP-RS
- data_dir not set HOT 2
- 500 for errors parsing RDF HOT 1
- Spec 3.2.1: Update "include" and "omit" Prefer URIs
- Spec 3.1.1: Add "include" and "omit" URIs for LDPC
- Spec 3.1.1: Direct & Indirect Containers HOT 1
- Revisit direct and indirect containment logic HOT 1
- Spec 3.1.4: explicit LDP-NR creation HOT 1
- Spec 3.1.5: constraints document HOT 1
- Spec 3.2.1: `PreferInboundReferences` pref header HOT 2
- Spec 3.2.2: describe LDP-NR
- Spec 3.2.3: `Want-Digest`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lakesuperior.