summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2011-04-28 08:46:50 +0200
committerDaniel Wagner <daniel.wagner@bmw-carit.de>2011-04-28 17:31:28 +0200
commit6657e88bf6e8630134558964d8fdb4e6f717a23c (patch)
tree4dc9a5b1e22c8f81f1a217f742a29653345a86b4 /test
parent3a370e11415be7f8a6d8c253c9f45006c3d4a73b (diff)
downloadconnman-6657e88bf6e8630134558964d8fdb4e6f717a23c.tar.gz
connman-6657e88bf6e8630134558964d8fdb4e6f717a23c.tar.bz2
connman-6657e88bf6e8630134558964d8fdb4e6f717a23c.zip
test-session: Print more user friendly messages
Diffstat (limited to 'test')
-rwxr-xr-xtest/test-session19
1 files changed, 17 insertions, 2 deletions
diff --git a/test/test-session b/test/test-session
index 9784122f..5f0685bc 100755
--- a/test/test-session
+++ b/test/test-session
@@ -172,6 +172,11 @@ class SessionApplication(dbus.service.Object):
in_signature='', out_signature='')
def Connect(self):
print "Connect session"
+
+ if self.session == None:
+ print "no session running -> drop request"
+ return
+
try:
self.session.Connect()
except dbus.DBusException, e:
@@ -185,6 +190,11 @@ class SessionApplication(dbus.service.Object):
in_signature='', out_signature='')
def Disconnect(self):
print "Disconnect session"
+
+ if self.session == None:
+ print "no session running -> drop request"
+ return
+
try:
self.session.Disconnect()
except dbus.DBusException, e:
@@ -198,6 +208,11 @@ class SessionApplication(dbus.service.Object):
in_signature='sv', out_signature='')
def Change(self, key, value):
print "Update session settings"
+
+ if self.session == None:
+ print "no session running -> drop request"
+ return
+
try:
val = self.type_convert(key, value)
self.session.Change(key, val)
@@ -281,14 +296,14 @@ def main():
app.Disconnect()
elif sys.argv[1] == "change":
- if len(sys.argv) < 4:
+ if len(sys.argv) < 5:
print "Arguments missing"
sys.exit(1)
app.Change(sys.argv[3], sys.argv[4:])
elif sys.argv[1] == "configure":
- if len(sys.argv) < 4:
+ if len(sys.argv) < 5:
print "Arguments missing"
sys.exit(1)