summaryrefslogtreecommitdiff
path: root/test/test_diff.py
blob: 73d274df704d9147711e2524d181533b0dc03a77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import unittest
import rdflib
from rdflib.compare import graph_diff

"""Test for graph_diff - much more extensive testing 
would certainly be possible"""

class TestDiff(unittest.TestCase):
    """Unicode literals for graph_diff test
    (issue 151)"""

    def testA(self): 
        """with bnode"""
        g=rdflib.Graph()
        g.add( (rdflib.BNode(), rdflib.URIRef("urn:p"), rdflib.Literal(u'\xe9') ) ) 

        diff=graph_diff(g,g)

    def testB(self): 

        """Curiously, this one passes, even before the fix in issue 151"""

        g=rdflib.Graph()
        g.add( (rdflib.URIRef("urn:a"), rdflib.URIRef("urn:p"), rdflib.Literal(u'\xe9') ) ) 

        diff=graph_diff(g,g)


if __name__ == "__main__":
    unittest.main()