From 1faead71aa79c148288470b9837e50a36746d6bf Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 5 Jan 2010 18:07:12 -0600 Subject: [PATCH] test: handle various missing operator strings if the modem doesn't report them --- test/mm-test.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/mm-test.py b/test/mm-test.py index 157fb0ec..a0af8419 100755 --- a/test/mm-test.py +++ b/test/mm-test.py @@ -224,10 +224,12 @@ def gsm_inspect(proxy, dump_private, do_scan): except KeyError: pass - if len(r['operator-long']): + if r.has_key('operator-long') and len(r['operator-long']): print "%s: %s %s" % (r['operator-long'], status, access_tech) - else: + elif r.has_key('operator-short') and len(r['operator-short']): print "%s: %s %s" % (r['operator-short'], status, access_tech) + else: + print "%s: %s %s" % (r['operator-num'], status, access_tech) def gsm_connect(proxy, apn, user, password): # Modem.Simple interface