File: test_issue579.py

package info (click to toggle)
rdflib 7.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 77,852 kB
  • sloc: python: 59,555; sh: 153; makefile: 83; ruby: 74; xml: 45
file content (18 lines) | stat: -rw-r--r-- 550 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# test for https://github.com/RDFLib/rdflib/issues/579

from rdflib import Graph, Literal, Namespace
from rdflib.namespace import FOAF


def test_issue579():
    g = Graph()
    g.bind("foaf", FOAF)
    n = Namespace("http://myname/")
    g.add((n.bob, FOAF.name, Literal("bb")))
    # query is successful.
    assert len(g.query("select ?n where { ?n foaf:name 'bb' . }")) == 1
    # update is not.
    g.update("delete where { ?e foaf:name 'ss' .}")
    assert len(g) == 1
    g.update("delete where { ?e foaf:name 'bb' .}")
    assert len(g) == 0