blacked test_issue910.py + some hand styling; removed print statements
-from rdflib import Namespace, Graph, BNode, Literal
+from rdflib import Graph
import unittest
class TestIssue910(unittest.TestCase):
-
def testA(self):
g = Graph()
- qres = g.query("""SELECT * {
+ q = g.query(
+ """
+ SELECT * {
{ BIND ("a" AS ?a) }
UNION
{ BIND ("a" AS ?a) }
- }""")
- self.assertEqual(len(qres) == 2, True)
- for row in qres:
- print (row)
-
- print ("Test A successful.")
+ }
+ """
+ )
+ self.assertEqual(len(q) == 2, True)
def testB(self):
g = Graph()
- qres = g.query("""SELECT * {
+ q = g.query(
+ """
+ SELECT * {
{ BIND ("a" AS ?a) }
UNION
{ VALUES ?a { "a" } }
UNION
{ SELECT ("a" AS ?a) {} }
- }""")
- self.assertEqual(len(qres) == 3, True)
- for row in qres:
- print (row)
-
- print ("Test B successful.")
+ }
+ """
+ )
+ self.assertEqual(len(q) == 3, True)
def testC(self):
g = Graph()
- qres = g.query("""SELECT * {
+ q = g.query(
+ """
+ SELECT * {
{ BIND ("a" AS ?a) }
UNION
{ VALUES ?a { "a" } }
UNION
{ SELECT ("b" AS ?a) {} }
- }""")
- self.assertEqual(len(qres) == 3, True)
- for row in qres:
- print (row)
-
- print ("Test C successful.")
+ }
+ """
+ )
+ self.assertEqual(len(q) == 3, True)
def testD(self):
g = Graph()
- qres = g.query("""SELECT * {
+ q = g.query(
+ """SELECT * {
{ BIND ("a" AS ?a) }
UNION
{ VALUES ?a { "b" } }
UNION
{ SELECT ("c" AS ?a) {} }
- }""")
- self.assertEqual(len(qres) == 3, True)
- for row in qres:
- print (row)
-
- print ("Test D successful.")
-
+ }
+ """
+ )
+ self.assertEqual(len(q) == 3, True)
if __name__ == "__main__":
