From fda71cefbafb07c517ce87ed072c7bfc619fd7e2 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 17 Aug 2010 00:41:02 +0200 Subject: Add support for multiple response USSD transactions in test script --- test/initiate-ussd | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) (limited to 'test/initiate-ussd') diff --git a/test/initiate-ussd b/test/initiate-ussd index ab0a8c46..198b4277 100755 --- a/test/initiate-ussd +++ b/test/initiate-ussd @@ -38,22 +38,15 @@ if state == "idle": print "State: %s" % (state) -if state != "user-response": - ussd.Cancel() - sys.exit(0) - -response = raw_input("Enter response: ") - -result = ussd.Respond(response) +while state == "user-response": + response = raw_input("Enter response: ") -properties = ussd.GetProperties() -state = properties["State"] + result = ussd.Respond(response, timeout=100) -print result + properties = ussd.GetProperties() + state = properties["State"] -if state == "idle": - sys.exit(0) - -print "State: %s" % (state) + print result -ussd.Cancel() + if state != "idle": + print "State: %s" % (state) -- cgit v1.2.3