File: test_issue1998.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 (16 lines) | stat: -rw-r--r-- 430 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
"""Test that N-Triples formats do not have double newlines at the end
of the output.

https://github.com/RDFLib/rdflib/issues/1998
"""

import rdflib


def test_1998():
    g = rdflib.Graph()
    bob = rdflib.URIRef("http://example.org/people/Bob")
    g.add((bob, rdflib.RDF.type, rdflib.FOAF.Person))
    for nt_format in ("nt", "nt11"):
        output = g.serialize(format=nt_format)
        assert not output.endswith("\n\n")