[tracker] functional-tests: add stats iface in the convenience wrapper



commit e77db6d93d83a85510252e2903215c9aea6718a5
Author: Ivan Frade <ivan frade nokia com>
Date:   Wed Sep 15 20:34:31 2010 +0300

    functional-tests: add stats iface in the convenience wrapper

 .../common/utils/configuration.py.in               |    3 +++
 tests/functional-tests/common/utils/helpers.py     |   10 ++++++++++
 2 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/tests/functional-tests/common/utils/configuration.py.in b/tests/functional-tests/common/utils/configuration.py.in
index d745dd4..a8188a8 100644
--- a/tests/functional-tests/common/utils/configuration.py.in
+++ b/tests/functional-tests/common/utils/configuration.py.in
@@ -33,6 +33,9 @@ MINER_IFACE = "org.freedesktop.Tracker1.Miner"
 TRACKER_BACKUP_OBJ_PATH = "/org/freedesktop/Tracker1/Backup"                                            
 BACKUP_IFACE = "org.freedesktop.Tracker1.Backup"
 
+TRACKER_STATS_OBJ_PATH = "/org/freedesktop/Tracker1/Statistics"
+STATS_IFACE = "org.freedesktop.Tracker1.Statistics"
+
 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 b3b78be..905d329 100644
--- a/tests/functional-tests/common/utils/helpers.py
+++ b/tests/functional-tests/common/utils/helpers.py
@@ -46,6 +46,9 @@ class StoreHelper:
         tracker_backup = bus.get_object (cfg.TRACKER_BUSNAME, cfg.TRACKER_BACKUP_OBJ_PATH)
         self.backup_iface = dbus.Interface (tracker_backup, dbus_interface=cfg.BACKUP_IFACE)
 
+        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)
+
     def query (self, query, timeout=5000):
         try:
             return self.resources.SparqlQuery (query, timeout=timeout)
@@ -84,6 +87,13 @@ class StoreHelper:
             self.connect ()
             return self.backup_iface.Restore (backup_file)
 
+    def get_stats (self):
+        try:
+            return self.stats_iface.Get ()
+        except dbus.DBusException:
+            self.connect ()
+            return self.stats_iface.Get ()
+
     def get_tracker_iface (self):
         return self.resources
 



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