summaryrefslogtreecommitdiff
path: root/test/test_issues/test_issue801.py
blob: 0dfac052bccc30c52b01ae1436f2f9d53ed126da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
"""
Issue 801 - Problem with prefixes created for URIs containing %20
"""
import unittest

from rdflib import BNode, Graph, Literal, Namespace


class TestIssue801(unittest.TestCase):
    def test_issue_801(self):
        g = Graph()
        example = Namespace("http://example.org/")
        g.bind("", example)
        node = BNode()
        g.add((node, example["first%20name"], Literal("John")))
        self.assertEqual(
            g.serialize(format="turtle").split("\n")[-3], '[] :first%20name "John" .'
        )


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