File: test_issue523.py

package info (click to toggle)
rdflib 6.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 38,248 kB
  • sloc: python: 39,216; sh: 153; makefile: 110
file content (21 lines) | stat: -rw-r--r-- 483 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# test for https://github.com/RDFLib/rdflib/issues/523

import rdflib


def test_issue523():
    g = rdflib.Graph()
    r = g.query(
        "SELECT (<../baz> as ?test) WHERE {}",
        base=rdflib.URIRef("http://example.org/foo/bar"),
    )
    res = r.serialize(format="csv")
    assert res == b"test\r\nhttp://example.org/baz\r\n", repr(res)

    # expected result:
    # test
    # http://example.org/baz

    # actual result;
    # test
    # http://example.org/foo/bar../baz