[tracker/tracker-0.10] functional-tests: Add another GRAPH with REPLACE behaviour test
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/tracker-0.10] functional-tests: Add another GRAPH with REPLACE behaviour test
- Date: Wed, 30 Mar 2011 16:08:04 +0000 (UTC)
commit 8cf0eaa9b2400aab34f8f9657271f937f47910fd
Author: Philip Van Hoof <philip codeminded be>
Date: Thu Mar 24 15:23:16 2011 +0100
functional-tests: Add another GRAPH with REPLACE behaviour test
tests/functional-tests/01-insertion.py | 36 ++++++++++++++++++++++++++++---
1 files changed, 32 insertions(+), 4 deletions(-)
---
diff --git a/tests/functional-tests/01-insertion.py b/tests/functional-tests/01-insertion.py
index 4496c52..2cfd984 100755
--- a/tests/functional-tests/01-insertion.py
+++ b/tests/functional-tests/01-insertion.py
@@ -334,10 +334,10 @@ class TrackerStoreInsertionTests (CommonTrackerStoreTest):
Insert or replace, single and multi valued properties with graphs
"""
- INSERT_SPARQL = """INSERT { GRAPH <test://graph-1> { <test://instance-6> a nie:InformationElement ; nie:title 'test' } }"""
+ INSERT_SPARQL = """INSERT { GRAPH <test://graph-1> { <test://instance-6> a nie:InformationElement ; nie:title 'title 1' } }"""
self.tracker.update (INSERT_SPARQL)
- INSERT_SPARQL = """INSERT OR REPLACE { GRAPH <test://graph-2> { <test://instance-6> nie:title 'test' } }"""
+ INSERT_SPARQL = """INSERT { GRAPH <test://graph-2> { <test://instance-6> nie:title 'title 1' } }"""
self.tracker.update (INSERT_SPARQL)
result = self.tracker.query ("""
@@ -347,8 +347,36 @@ class TrackerStoreInsertionTests (CommonTrackerStoreTest):
self.assertEquals (len (result), 1)
self.assertEquals (len (result[0]), 2)
- self.assertEquals (result[0][0], "test://graph-2")
- self.assertEquals (result[0][1], "test")
+ self.assertEquals (result[0][0], "test://graph-1") # Yes, indeed
+ self.assertEquals (result[0][1], "title 1")
+
+ INSERT_SPARQL = """INSERT OR REPLACE { GRAPH <test://graph-2> { <test://instance-6> nie:title 'title 1' } }"""
+ self.tracker.update (INSERT_SPARQL)
+
+ result = self.tracker.query ("""
+ SELECT ?g ?t WHERE { GRAPH ?g {
+ <test://instance-6> nie:title ?t
+ } }""")
+
+ self.assertEquals (len (result), 1)
+ self.assertEquals (len (result[0]), 2)
+ self.assertEquals (result[0][0], "test://graph-2") # Yup, that's right
+ self.assertEquals (result[0][1], "title 1")
+
+
+ INSERT_SPARQL = """INSERT OR REPLACE { GRAPH <test://graph-3> { <test://instance-6> nie:title 'title 2' } }"""
+ self.tracker.update (INSERT_SPARQL)
+
+ result = self.tracker.query ("""
+ SELECT ?g ?t WHERE { GRAPH ?g {
+ <test://instance-6> nie:title ?t
+ } }""")
+
+ self.assertEquals (len (result), 1)
+ self.assertEquals (len (result[0]), 2)
+ self.assertEquals (result[0][0], "test://graph-3")
+ self.assertEquals (result[0][1], "title 2")
+
def __insert_valid_date_test (self, datestring, year, month, day, hours, minutes, seconds, timezone):
"""
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]