aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2012-02-02 21:12:17 -0600
committerDan Williams <dcbw@redhat.com>2012-02-02 21:12:17 -0600
commit76c9b29415a89a1804fcc17be737a2b09fe1109f (patch)
treedd91f21fa31cee2936a48ee0a011ad57d4fb1c52 /test
parent681a24c8d87cad064696d1dcf17ec78a23823d0c (diff)
test: (sms-get.py) don't fail if we don't get an SMSC
Diffstat (limited to 'test')
-rwxr-xr-xtest/sms-get.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/sms-get.py b/test/sms-get.py
index 7bfb3125..981fb5d6 100755
--- a/test/sms-get.py
+++ b/test/sms-get.py
@@ -55,7 +55,13 @@ msgs = sms.List()
i = 0
for m in msgs:
print "-------------------------------------------------------------------"
- print "%d: From: %s Time: %s SMSC: %s" % (m["index"], m["number"], m["timestamp"], m["smsc"])
+ smsc = ""
+ try:
+ smsc = m["smsc"]
+ except KeyError:
+ pass
+
+ print "%d: From: %s Time: %s SMSC: %s" % (m["index"], m["number"], m["timestamp"], smsc)
if len(m["text"]):
print " %s\n" % m["text"]
elif len(m["data"]):