[tracker/rss-enclosures] functional-tests: add Wait method to the store wrapper



commit 74d8cf8f81c86cf041395f3fbfb0eec740d32b43
Author: Ivan Frade <ivan frade nokia com>
Date:   Wed Oct 6 19:04:12 2010 +0300

    functional-tests: add Wait method to the store wrapper

 .../common/utils/configuration.py.in               |    3 +++
 tests/functional-tests/common/utils/helpers.py     |   11 +++++++++++
 2 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/tests/functional-tests/common/utils/configuration.py.in b/tests/functional-tests/common/utils/configuration.py.in
index a8188a8..29412f0 100644
--- a/tests/functional-tests/common/utils/configuration.py.in
+++ b/tests/functional-tests/common/utils/configuration.py.in
@@ -36,6 +36,9 @@ BACKUP_IFACE = "org.freedesktop.Tracker1.Backup"
 TRACKER_STATS_OBJ_PATH = "/org/freedesktop/Tracker1/Statistics"
 STATS_IFACE = "org.freedesktop.Tracker1.Statistics"
 
+TRACKER_STATUS_OBJ_PATH = "/org/freedesktop/Tracker1/Status"
+STATUS_IFACE = "org.freedesktop.Tracker1.Status"
+
 TRACKER_EXTRACT_BUSNAME = "org.freedesktop.Tracker1.Extract"
 TRACKER_EXTRACT_OBJ_PATH = "/org/freedesktop/Tracker1/Extract"
 TRACKER_EXTRACT_IFACE = "org.freedesktop.Tracker1.Extract"
diff --git a/tests/functional-tests/common/utils/helpers.py b/tests/functional-tests/common/utils/helpers.py
index c358469..0431dc2 100644
--- a/tests/functional-tests/common/utils/helpers.py
+++ b/tests/functional-tests/common/utils/helpers.py
@@ -49,6 +49,9 @@ class StoreHelper:
         tracker_stats = bus.get_object (cfg.TRACKER_BUSNAME, cfg.TRACKER_STATS_OBJ_PATH)
         self.stats_iface = dbus.Interface (tracker_stats, dbus_interface=cfg.STATS_IFACE)
 
+        tracker_status = bus.get_object (cfg.TRACKER_BUSNAME, cfg.TRACKER_STATUS_OBJ_PATH)
+        self.status_iface = dbus.Interface (tracker_status, dbus_interface=cfg.STATUS_IFACE)
+
     def query (self, query, timeout=5000):
         try:
             return self.resources.SparqlQuery (query, timeout=timeout)
@@ -94,6 +97,14 @@ class StoreHelper:
             self.connect ()
             return self.stats_iface.Get ()
 
+    def wait (self):
+        try:
+            return self.status_iface.Wait ()
+        except dbus.DBusException:
+            self.connect ()
+            return self.status_iface.Wait ()
+
+
     def get_tracker_iface (self):
         return self.resources
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]