Skip to content

Commit

Permalink
Fix helper tests
Browse files Browse the repository at this point in the history
  • Loading branch information
white-gecko committed Jun 29, 2023
1 parent 6bbb121 commit 3dc77e0
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions tests/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ def testBaseNamespace(self):
self.assertEqual(queryType, 'SelectQuery')

queryType, parsedQuery = parse_update_type(update)
self.assertEqual(parsedQuery[0]['triples'][0][0], URIRef('http://good.example/1'))
self.assertEqual(parsedQuery[0]['triples'][0][1], URIRef('http://good.example/2'))
self.assertEqual(parsedQuery[0]['triples'][0][2], URIRef('http://good.example/3'))
parsedQueryAlgebra = parsedQuery.algebra
self.assertEqual(parsedQueryAlgebra[0]['triples'][0][0], URIRef('http://good.example/1'))
self.assertEqual(parsedQueryAlgebra[0]['triples'][0][1], URIRef('http://good.example/2'))
self.assertEqual(parsedQueryAlgebra[0]['triples'][0][2], URIRef('http://good.example/3'))
self.assertEqual(queryType, 'InsertData')

queryType, parsedQuery = parse_query_type(construct)
Expand All @@ -44,15 +45,17 @@ def testOverwrittenBaseNamespace(self):
update2 = "PREFIX ex: <http://ex.org/> BASE <http://in-query/> INSERT DATA { <1> <2> <3> }"

queryType, parsedQuery = parse_update_type(update1, 'http://argument/')
self.assertEqual(parsedQuery[0]['triples'][0][0], URIRef('http://argument/1'))
self.assertEqual(parsedQuery[0]['triples'][0][1], URIRef('http://argument/2'))
self.assertEqual(parsedQuery[0]['triples'][0][2], URIRef('http://argument/3'))
parsedQueryAlgebra = parsedQuery.algebra
self.assertEqual(parsedQueryAlgebra[0]['triples'][0][0], URIRef('http://argument/1'))
self.assertEqual(parsedQueryAlgebra[0]['triples'][0][1], URIRef('http://argument/2'))
self.assertEqual(parsedQueryAlgebra[0]['triples'][0][2], URIRef('http://argument/3'))
self.assertEqual(queryType, 'InsertData')

queryType, parsedQuery = parse_update_type(update2, 'http://argument/')
self.assertEqual(parsedQuery[0]['triples'][0][0], URIRef('http://in-query/1'))
self.assertEqual(parsedQuery[0]['triples'][0][1], URIRef('http://in-query/2'))
self.assertEqual(parsedQuery[0]['triples'][0][2], URIRef('http://in-query/3'))
parsedQueryAlgebra = parsedQuery.algebra
self.assertEqual(parsedQueryAlgebra[0]['triples'][0][0], URIRef('http://in-query/1'))
self.assertEqual(parsedQueryAlgebra[0]['triples'][0][1], URIRef('http://in-query/2'))
self.assertEqual(parsedQueryAlgebra[0]['triples'][0][2], URIRef('http://in-query/3'))
self.assertEqual(queryType, 'InsertData')

def testOverwrittenBadBaseNamespace(self):
Expand Down

0 comments on commit 3dc77e0

Please sign in to comment.