summaryrefslogtreecommitdiff
path: root/test/test_diff.py
blob: 0fb8d265c964fe9879e1467b5cb064e6cf4a0e4e (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
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("\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("\xe9")))

        diff = graph_diff(g, g)


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