/[papo]/gnue/appserver/src/test.py
ViewVC logotype

Diff of /gnue/appserver/src/test.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by styxman, Fri Nov 8 16:39:49 2002 UTC revision 1.4.4.1 by anthonyl, Tue Mar 4 22:03:55 2003 UTC
# Line 1  Line 1 
1  # GNU Enterprise Application Server - Test Program  # GNU Enterprise Application Server - Test Program
2  #  #
3  # Copyright 2001 Free Software Foundation  # Copyright 2001-2003 Free Software Foundation
4  #  #
5  # This file is part of GNU Enterprise.  # This file is part of GNU Enterprise.
6  #  #
# Line 56  class testApp (GClientApp.GClientApp): Line 56  class testApp (GClientApp.GClientApp):
56      session.login ("hacker", "secret")      session.login ("hacker", "secret")
57    
58      print "Creating list object ..."      print "Creating list object ..."
59      list = session.createList ("person")      list = session.createList ("address_person")
60    
61      print "Setting up list object ..."      print "Setting up list object ..."
62      list.setPrefetch (["name", "street", "city"])      list.setPrefetch (["address_name", "address_street", "address_city"])
63      list.setConditions ([])      list.setConditions ([])
64      list.setSort (["zip"])      list.setSort (["address_zip"])
65    
66      print "Populating list ..."      print "Populating list ..."
67      list.populate ()      list.populate ()
# Line 70  class testApp (GClientApp.GClientApp): Line 70  class testApp (GClientApp.GClientApp):
70      instance = list.firstInstance ()      instance = list.firstInstance ()
71    
72      print "These are the values of the first instance:"      print "These are the values of the first instance:"
73      print "  Name  :", instance.get ("name")      print "  Name  :", instance.get ("address_name")
74      print "  Street:", instance.get ("street")      print "  Street:", instance.get ("address_street")
75      print "  City  :", instance.get ("city")      print "  City  :", instance.get ("address_city")
76    
77      print "Check if person live in a rich/poor area:"  #   print "Check if person live in a rich/poor area:"
78      print "  calling 'checkAreaRichness' results in: ",  #   print "  calling 'checkAreaRichness' results in: ",
79      instance.call('checkAreaRichness','') # demographic data  #   instance.call('checkAreaRichness','') # demographic data
80    
81      print "Thank you for playing!"      print "Thank you for playing!"
82    
# Line 86  class testApp (GClientApp.GClientApp): Line 86  class testApp (GClientApp.GClientApp):
86    
87  class testLoginHandler (GLoginHandler.LoginHandler):  class testLoginHandler (GLoginHandler.LoginHandler):
88    def getLogin (self, *arguments):    def getLogin (self, *arguments):
89      # for this test program, try to log into the database as the current user      return {"_username": "gnue", "_password": None}
     username = os.environ ["LOGNAME"]  
     return {"_username": username, "_password": "(none)"}  
90    
91  # =============================================================================  # =============================================================================
92  # Let it rock  # Let it rock

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.4.4.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26