diff options
author | Bertrand Aygon <bertrand.aygon@intel.com> | 2011-03-09 14:31:35 +0100 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2011-03-11 14:00:36 -0600 |
commit | afd4773d54f6800f96b90ff2d64b0df4e91d5467 (patch) | |
tree | da32a1534a687c29870c07a7143e61dc08572808 /test/test-message-waiting | |
parent | 8ee5a49fc25d1a66a85edd6ee831832520b79824 (diff) | |
download | ofono-afd4773d54f6800f96b90ff2d64b0df4e91d5467.tar.gz |
test: Add test-message-waiting
Add a new test file to validate org.ofono.MessageWaiting interface
Diffstat (limited to 'test/test-message-waiting')
-rwxr-xr-x | test/test-message-waiting | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/test/test-message-waiting b/test/test-message-waiting new file mode 100755 index 00000000..3abe0bad --- /dev/null +++ b/test/test-message-waiting @@ -0,0 +1,40 @@ +#!/usr/bin/python + +import gobject +import sys +import dbus +import dbus.mainloop.glib + +def mw_property_changed(name, value): + if name == 'VoicemailMessageCount': + print "MessageWaiting property: '%s' changed to '%d'" %\ + (name,value) + else: + print "MessageWaiting property: '%s' changed to '%s'" %\ + (name,value) + +if __name__ == "__main__": + dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) + + bus = dbus.SystemBus() + + manager = dbus.Interface(bus.get_object('org.ofono', '/'), + 'org.ofono.Manager') + + modems = manager.GetModems() + + mw = dbus.Interface(bus.get_object('org.ofono', modems[0][0]), + 'org.ofono.MessageWaiting') + + mw.connect_to_signal("PropertyChanged", mw_property_changed) + + properties = mw.GetProperties() + + print "Voicemail waiting: %s" % (properties['VoicemailWaiting']) + print "Voicemail message count: %d" %\ + (properties['VoicemailMessageCount']) + print "Voicemail mailbox number: %s" %\ + (properties['VoicemailMailboxNumber']) + + mainloop = gobject.MainLoop() + mainloop.run() |