test: Add send-vcard script
authorDenis Kenzior <denkenz@gmail.com>
Thu, 4 Nov 2010 15:20:23 +0000 (10:20 -0500)
committerDenis Kenzior <denkenz@gmail.com>
Thu, 4 Nov 2010 15:25:42 +0000 (10:25 -0500)
Makefile.am
test/send-vcard [new file with mode: 0755]

index 0bf415b..05082de 100644 (file)
@@ -415,7 +415,8 @@ test_scripts = test/backtrace \
                test/get-icon \
                test/set-fast-dormancy \
                test/test-push-notification \
-               test/test-smart-messaging
+               test/test-smart-messaging \
+               test/send-vcard
 
 if TEST
 testdir = $(pkglibdir)/test
diff --git a/test/send-vcard b/test/send-vcard
new file mode 100755 (executable)
index 0000000..d11d5ac
--- /dev/null
@@ -0,0 +1,20 @@
+#!/usr/bin/python
+
+import sys
+import dbus
+
+bus = dbus.SystemBus()
+
+manager = dbus.Interface(bus.get_object('org.ofono', '/'),
+                                               'org.ofono.Manager')
+
+modems = manager.GetModems()
+path = modems[0][0]
+
+manager = dbus.Interface(bus.get_object('org.ofono', path),
+                                       'org.ofono.SmartMessaging')
+
+vcard = file(sys.argv[2]).read()
+path = manager.SendBusinessCard(sys.argv[1], vcard)
+
+print path