summaryrefslogtreecommitdiff
path: root/test/data/defined_namespaces
Commit message (Collapse)AuthorAgeFilesLines
* fix: HTTP 308 Permanent Redirect status code handling (#2389)Iwan Aucamp2023-05-173-0/+582
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change the handling of HTTP status code 308 to behave more like `urllib.request.HTTPRedirectHandler`, most critically, the new 308 handling will create a new `urllib.request.Request` object with the new URL, which will prevent state from being carried over from the original request. One case where this is important is when the domain name changes, for example, when the original URL is `http://www.w3.org/ns/adms.ttl` and the redirect URL is `https://uri.semic.eu/w3c/ns/adms.ttl`. With the previous behaviour, the redirect would contain a `Host` header with the value `www.w3.org` instead of `uri.semic.eu` because the `Host` header is placed in `Request.unredirected_hdrs` and takes precedence over the `Host` header in `Request.headers`. Other changes: - Only handle HTTP status code 308 on Python versions before 3.11 as Python 3.11 will handle 308 by default [[ref](https://docs.python.org/3.11/whatsnew/changelog.html#id128)]. - Move code which uses `http://www.w3.org/ns/adms.ttl` and `http://www.w3.org/ns/adms.rdf` out of `test_guess_format_for_parse` into a separate parameterized test, which instead uses the embedded http server. This allows the test to fully control the `Content-Type` header in the response instead of relying on the value that the server is sending. This is needed because the server is sending `Content-Type: text/plain` for the `adms.ttl` file, which is not a valid RDF format, and the test is expecting `Content-Type: text/turtle`. Fixes: - <https://github.com/RDFLib/rdflib/issues/2382>.
* Add more namespaces to test utils (#1980)Iwan Aucamp2022-06-054-0/+416
| | | | | | | | | | | | | | | | | | This patch adds the following namespaces to `test.utils.namespace` as `DefinedNamespace`s: - DAWGT: `http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#` - MF: `http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#` - QT: `http://www.w3.org/2001/sw/DataAccess/tests/test-query#` - UT: `http://www.w3.org/2009/sparql/tests/test-update#` Other changes: - Change `test_sparql_w3c.py` to use the new defined namespaces. - Change logging format for pytest to include milliseconds so it is easier to see what is slow. - Ignore `-N815` for `test/utils/namespace/_*` - Add source files for manifests to `test/data/defined_namespaces`, this is so we can use them in tests.
* feat: add tests and typing for `rdflib.utils.{get_tree,find_roots}` (#1935)Iwan Aucamp2022-05-151-0/+129
| | | | | | | | | | I wanted to see if these are useful for what I wanted to do and I was unsure about what exactly they are doing, wanted to be sure so I added some tests to check the current behavior. Also: - Add rdftest.ttl to `test/data/defined_namespaces/` using fetcher I'm using it to test `get_tree` and `find_roots`.
* test: move rdfs.ttl into `test/data/defined_namespaces` (#1936)Iwan Aucamp2022-05-151-0/+109
| | | Just to make things a bit more organized.
* test re-orgGraham Higgins2022-04-163-0/+41967