From: Ed Page Date: Thu, 14 Jan 2010 02:11:19 +0000 (-0600) Subject: Updating hand tests X-Git-Url: http://git.maemo.org/git/?p=theonering;a=commitdiff_plain;h=55e9cc3fba3c5e0883d73fda1a59d8291cb44733 Updating hand tests --- diff --git a/hand_tests/call.py b/hand_tests/call.py new file mode 100755 index 0000000..9213ffc --- /dev/null +++ b/hand_tests/call.py @@ -0,0 +1,53 @@ +#!/usr/bin/python + +import sys +sys.path.insert(0,"../src") +import logging + +import gvoice.backend as backend + + +def main(): + logging.basicConfig(level=logging.DEBUG) + + args = sys.argv + username = args[1] + password = args[2] + + PHONE_TYPE_HOME = 1 + PHONE_TYPE_MOBILE = 2 + PHONE_TYPE_WORK = 3 + PHONE_TYPE_GIZMO = 7 + + outgoingNumber = args[3] + forward = args[4] + subscriber = args[5] # Number or "undefined" + phoneType = args[6] # See PHONE_TYPE_* + remember = args[7] # "1" or "0" + if len(args) == 9: + cookiePath = args[8] + else: + cookiePath = None + + b = backend.GVoiceBackend(cookiePath) + b.login(username, password) + assert b.is_authed() + + callData = { + 'outgoingNumber': outgoingNumber, + 'forwardingNumber': forward, + 'subscriberNumber': subscriber, + 'phoneType': phoneType, + 'remember': remember, + } + logging.info("%r" % callData) + + page = b._get_page_with_token( + b._callUrl, + callData, + ) + print page + + +if __name__ == "__main__": + main() diff --git a/hand_tests/gv.py b/hand_tests/gv.py index c481dcb..30e4709 100755 --- a/hand_tests/gv.py +++ b/hand_tests/gv.py @@ -49,8 +49,13 @@ def main(): pprint.pprint(contact) if False: - print "Messages: ", - for message in b.get_conversations(): + print "Texts: ", + for message in b.get_texts(): + pprint.pprint(message.to_dict()) + + if False: + print "Voicemails: ", + for message in b.get_voicemails(): pprint.pprint(message.to_dict()) return b