[pkg-fso-commits] [SCM] FSO frameworkd Debian packaging branch, master, updated. milestone3-274-gd9a0e57

Guillaume Chereau charlie at openmoko.org
Tue Nov 11 17:09:17 UTC 2008


The following commit has been merged in the master branch:
commit b1de70790833b9da3241b35e8f9a1c26843bc0e5
Author: Guillaume Chereau <charlie at openmoko.org>
Date:   Wed Oct 29 11:10:23 2008 +0800

    tests: added oevents tests

diff --git a/tests/oevents.py b/tests/oevents.py
new file mode 100755
index 0000000..9133a57
--- /dev/null
+++ b/tests/oevents.py
@@ -0,0 +1,36 @@
+#!/usr/bin/python -N
+"""
+framework tests
+
+(C) 2008 Guillaume 'Charlie' Chereau <charlie at openmoko.org>
+(C) 2008 Michael 'Mickey' Lauer <mlauer at vanille-media.de>
+(C) 2008 Openmoko, Inc.
+GPLv2 or later
+"""
+
+import unittest
+import gobject
+import threading
+import dbus
+from dbus.mainloop.glib import DBusGMainLoop
+DBusGMainLoop(set_as_default=True)
+
+import test
+
+class BaseTest(unittest.TestCase):
+    def setUp(self):
+        # We connect to the DBus object
+        self.bus = dbus.SystemBus()
+        self.events = self.bus.get_object('org.freesmartphone.oeventsd', '/org/freesmartphone/Events')
+    def test_add_rule(self):
+        """Try to add a rule and then remove it"""
+        rule = '{trigger: Test("test_add_rule"), actions: Debug("trigger test add rule"), name: my_test}'
+        self.events.AddRule(rule)
+        self.events.RemoveRule('my_test')
+
+
+if __name__ == '__main__':
+    test.check_debug_mode()
+
+    suite = unittest.defaultTestLoader.loadTestsFromTestCase(BaseTest)
+    result = unittest.TextTestRunner(verbosity=3).run(suite)
diff --git a/tests/test.py b/tests/test.py
index fffc45c..06ff657 100755
--- a/tests/test.py
+++ b/tests/test.py
@@ -157,7 +157,7 @@ check_debug_mode()
 if __name__ == '__main__':
     # This list all the modules containing the tests we want to run
     # TODO: provide command line arguments like in Mikey ogsmd test script
-    modules = ['test', 'opreferencesd', 'sim', 'opimd', 'ogsmd2']
+    modules = ['test', 'opreferencesd', 'sim', 'opimd', 'ogsmd2', 'oevents']
 
     for module in modules:
         module = __import__(module)

-- 
FSO frameworkd Debian packaging



More information about the pkg-fso-commits mailing list