{"id":52,"date":"2006-06-19T21:26:27","date_gmt":"2006-06-19T19:26:27","guid":{"rendered":"https:\/\/raphael.slinckx.net\/blog\/projects\/dbus-testing-framework\/"},"modified":"2006-06-19T21:30:07","modified_gmt":"2006-06-19T19:30:07","slug":"dbus-testing-framework","status":"publish","type":"page","link":"https:\/\/raphael.slinckx.net\/blog\/projects\/dbus-testing-framework","title":{"rendered":"DBus Testing Framework"},"content":{"rendered":"<h3>What is it ?<\/h3>\n<p>You may know that testing dbus services or debugging dbus clients is not always easy since it involves creating services and wiring up things you don&#8217;t really want to do in a test script.<\/p>\n<p>This framework (quite a buzzword) allows you to easily setup and run dbus services and clients in a linear python script.<\/p>\n<p>Originally written for the <a href=\"http:\/\/telepathy.freedesktop.org\">telepathy framework<\/a> (a inter process communication framework aiming to bring conversation as first-class desktop citizen) (don&#8217;t laugh rob), an heavy consumer of dbus stuff, and sponsored by <a href=\"http:\/\/projects.collabora.co.uk\">Collabora<\/a>.<\/p>\n<h3>Libnotify Sample<\/h3>\n<p>Just to have a teaser, here is a libnotify test sample, it opens a notification bubble and then close it and checks that the closing reason and id is correct:<\/p>\n<pre>self[\"notif\"] = (\"org.freedesktop.Notifications\",\r\n\"\/org\/freedesktop\/Notifications\",\r\n\"org.freedesktop.Notifications\")\r\n\r\nid = self[\"notif\"][\"Notify\"].call(\"notifname\", 0, \"\", \"title\", \"content\",[],{}, 0)\r\n\r\nself[\"notif\"][\"NotificationClosed\"].listen()\r\nself[\"notif\"][\"CloseNotification\"].call(id)\r\nresults = self[\"notif\"][\"NotificationClosed\"].wait()\r\n\r\nassert results[0] == id<\/pre>\n<h3>Documentation and download<\/h3>\n<p>You can access the <a href=\"https:\/\/raphael.slinckx.net\/blog\/documents\/dbus-testing-framework-tutorial\">full explanation and tutorial and documentation on this page<\/a>. For the moment the framework is a single <a href=\"https:\/\/raphael.slinckx.net\/files\/dbustesting.py\">python file available here<\/a> and you can download the <a href=\"https:\/\/raphael.slinckx.net\/files\/dbustesting-sample.py\">sample tests file<\/a> to get an idea of what kind of scripts can be written.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>What is it ? You may know that testing dbus services or debugging dbus clients is not always easy since it involves creating services and wiring up things you don&#8217;t really want to do in a test script. This framework (quite a buzzword) allows you to easily setup and run dbus services and clients in [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":48,"menu_order":0,"comment_status":"open","ping_status":"open","template":"page-comments.php","meta":{"footnotes":""},"class_list":["post-52","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/raphael.slinckx.net\/blog\/wp-json\/wp\/v2\/pages\/52","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/raphael.slinckx.net\/blog\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/raphael.slinckx.net\/blog\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/raphael.slinckx.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/raphael.slinckx.net\/blog\/wp-json\/wp\/v2\/comments?post=52"}],"version-history":[{"count":0,"href":"https:\/\/raphael.slinckx.net\/blog\/wp-json\/wp\/v2\/pages\/52\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/raphael.slinckx.net\/blog\/wp-json\/wp\/v2\/pages\/48"}],"wp:attachment":[{"href":"https:\/\/raphael.slinckx.net\/blog\/wp-json\/wp\/v2\/media?parent=52"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}