Updating hand tests
authorEd Page <eopage@byu.net>
Thu, 14 Jan 2010 02:11:19 +0000 (20:11 -0600)
committerEd Page <eopage@byu.net>
Thu, 14 Jan 2010 02:11:19 +0000 (20:11 -0600)
hand_tests/call.py [new file with mode: 0755]
hand_tests/gv.py

diff --git a/hand_tests/call.py b/hand_tests/call.py
new file mode 100755 (executable)
index 0000000..9213ffc
--- /dev/null
@@ -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()
index c481dcb..30e4709 100755 (executable)
@@ -49,8 +49,13 @@ def main():
                        pprint.pprint(contact)
 
        if False:
                        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
                        pprint.pprint(message.to_dict())
 
        return b