[d-feet] Use GTestDBus instead of Systembus and Sessionbus



commit d8a667697b9ccfc131e6ac69a97bc2fc77f60114
Author: Thomas Bechtold <thomasbechtold jpberlin de>
Date:   Sat May 25 18:34:44 2013 +0200

    Use GTestDBus instead of Systembus and Sessionbus

 src/tests/tests.py |   20 +++++++++-----------
 1 files changed, 9 insertions(+), 11 deletions(-)
---
diff --git a/src/tests/tests.py b/src/tests/tests.py
index 453bb8d..19d2f09 100755
--- a/src/tests/tests.py
+++ b/src/tests/tests.py
@@ -78,19 +78,17 @@ class IntrospectionHelperTest(unittest.TestCase):
 class AddressInfoTest(unittest.TestCase):
     """tests for the AddressInfo class and the introspection stuff"""
 
-    def test_system_bus(self):
-        """introspect a name on the system bus"""
-        ai = AddressInfo(DATA_DIR, Gio.BusType.SYSTEM, "org.freedesktop.DBus")
+    def setUp(self):
+        self.bus = Gio.TestDBus()
+        self.bus.unset()
+        self.bus.up()
 
-    def test_session_bus(self):
-        """introspect a name on the session bus"""
-        ai = AddressInfo(DATA_DIR, Gio.BusType.SESSION, "org.freedesktop.DBus")
+    def tearDown(self):
+        self.bus.stop()
 
-    @unittest.skip("TODO: create another bus and test with the other bus")
-    def test_other_bus(self):
-        """test another bus"""
-        sysbus_addr = os.getenv("DBUS_SYSTEM_BUS_ADDRESS")
-        ai = AddressInfo(DATA_DIR, sysbus_addr, "org.freedesktop.DBus")
+    def test_bus(self):
+        """introspect a name on the system bus"""
+        ai = AddressInfo(DATA_DIR, self.bus.get_bus_address(), "org.freedesktop.DBus")
 
     @unittest.skip("TODO:peer to peer test not implemented")
     def test_peer_to_peer(self):


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