diff options
| author | Nicholas Car <nicholas.car@surroundaustralia.com> | 2020-05-16 21:00:24 +1000 |
|---|---|---|
| committer | Nicholas Car <nicholas.car@surroundaustralia.com> | 2020-05-16 21:00:24 +1000 |
| commit | 0be6f6039479ce29cf71b11e76be54e186130036 (patch) | |
| tree | 897d208525a7e8952fb496151db074d49dcdeb3a /test/test_trix_serialize.py | |
| parent | 2a8d70824e1b4caf0c606074a44ac3a15fa72718 (diff) | |
| download | rdflib-0be6f6039479ce29cf71b11e76be54e186130036.tar.gz | |
blacked all python files
Diffstat (limited to 'test/test_trix_serialize.py')
| -rw-r--r-- | test/test_trix_serialize.py | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/test/test_trix_serialize.py b/test/test_trix_serialize.py index 3330234b..4fe78a18 100644 --- a/test/test_trix_serialize.py +++ b/test/test_trix_serialize.py @@ -9,7 +9,6 @@ from io import BytesIO class TestTrixSerialize(unittest.TestCase): - def setUp(self): pass @@ -18,17 +17,17 @@ class TestTrixSerialize(unittest.TestCase): def testSerialize(self): - s1 = URIRef('store:1') - r1 = URIRef('resource:1') - r2 = URIRef('resource:2') + s1 = URIRef("store:1") + r1 = URIRef("resource:1") + r2 = URIRef("resource:2") - label = URIRef('predicate:label') + label = URIRef("predicate:label") g1 = Graph(identifier=s1) g1.add((r1, label, Literal("label 1", lang="en"))) g1.add((r1, label, Literal("label 2"))) - s2 = URIRef('store:2') + s2 = URIRef("store:2") g2 = Graph(identifier=s2) g2.add((r2, label, Literal("label 3"))) @@ -37,13 +36,13 @@ class TestTrixSerialize(unittest.TestCase): g.addN([(s, p, o, g1)]) for s, p, o in g2.triples((None, None, None)): g.addN([(s, p, o, g2)]) - r3 = URIRef('resource:3') + r3 = URIRef("resource:3") g.add((r3, label, Literal(4))) - r = g.serialize(format='trix') + r = g.serialize(format="trix") g3 = ConjunctiveGraph() - g3.parse(BytesIO(r), format='trix') + g3.parse(BytesIO(r), format="trix") for q in g3.quads((None, None, None)): # TODO: Fix once getGraph/getContext is in conjunctive graph @@ -87,12 +86,10 @@ class TestTrixSerialize(unittest.TestCase): graph = ConjunctiveGraph() graph.bind(None, "http://defaultnamespace") - sg = graph.serialize(format='trix').decode('UTF-8') - self.assertTrue( - 'xmlns="http://defaultnamespace"' not in sg, sg) - self.assertTrue( - 'xmlns="http://www.w3.org/2004/03/trix/trix-1/' in sg, sg) + sg = graph.serialize(format="trix").decode("UTF-8") + self.assertTrue('xmlns="http://defaultnamespace"' not in sg, sg) + self.assertTrue('xmlns="http://www.w3.org/2004/03/trix/trix-1/' in sg, sg) -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() |
