Fork of https://github.com/oxigraph/oxigraph.git for the purpose of NextGraph project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
oxigraph/python/tests/test_serialize.py

24 lines
559 B

import unittest
import io
from pyoxigraph import *
class TestSerialize(unittest.TestCase):
def test_serialize(self):
output = io.BytesIO()
serialize(
[
Triple(
NamedNode("http://example.com"),
NamedNode("http://example.com/p"),
Literal("1"),
)
],
output,
"text/turtle",
)
assert (
output.getvalue() == b'<http://example.com> <http://example.com/p> "1" .\n'
)