[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnue] r7193 - in trunk/gnue-appserver/samples: . testing
From: |
johannes |
Subject: |
[gnue] r7193 - in trunk/gnue-appserver/samples: . testing |
Date: |
Sun, 13 Mar 2005 04:03:11 -0600 (CST) |
Author: johannes
Date: 2005-03-13 04:03:11 -0600 (Sun, 13 Mar 2005)
New Revision: 7193
Added:
trunk/gnue-appserver/samples/testing/qualify.py
Modified:
trunk/gnue-appserver/samples/sample.gcd
trunk/gnue-appserver/samples/testing/sorting.py
Log:
Updated testcases
Modified: trunk/gnue-appserver/samples/sample.gcd
===================================================================
--- trunk/gnue-appserver/samples/sample.gcd 2005-03-13 08:45:12 UTC (rev
7192)
+++ trunk/gnue-appserver/samples/sample.gcd 2005-03-13 10:03:11 UTC (rev
7193)
@@ -45,6 +45,10 @@
return None]]>
</property>
+ <property name="alwaystrue" type="boolean">
+ return True
+ </property>
+
<procedure name="show" comment="Simple procedure to test Appserver">
abort (message ('nameis') % self.address_name)
</procedure>
Added: trunk/gnue-appserver/samples/testing/qualify.py
===================================================================
--- trunk/gnue-appserver/samples/testing/qualify.py 2005-03-13 08:45:12 UTC
(rev 7192)
+++ trunk/gnue-appserver/samples/testing/qualify.py 2005-03-13 10:03:11 UTC
(rev 7193)
@@ -0,0 +1,46 @@
+# GNU Enterprise Application Server - Testing unit - Sorting
+#
+# Copyright 2003-2004 Free Software Foundation
+#
+# This file is part of GNU Enterprise.
+#
+# GNU Enterprise is free software; you can redistribute it
+# and/or modify it under the terms of the GNU General Public
+# License as published by the Free Software Foundation; either
+# version 2, or (at your option) any later version.
+#
+# GNU Enterprise is distributed in the hope that it will be
+# useful, but WITHOUT ANY WARRANTY; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+# PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public
+# License along with program; see the file COPYING. If not,
+# write to the Free Software Foundation, Inc., 59 Temple Place
+# - Suite 330, Boston, MA 02111-1307, USA.
+#
+# $Id$
+
+from gnue.appserver.language import App
+
+
+if __name__ == "__main__":
+ app = App.App ()
+
+ print "requesting new session ..."
+ session = app.newSession ('test', 'test')
+
+ session.setcontext ('address')
+
+ ctr = session.find ('country', {'code': 'US'})
+ country = ctr and ctr [0] or None
+
+ cond = ['eq', ['field', 'country'], ['const', country]]
+ order = ['name', ('street', True), {'name': 'country.name', 'ignoreCase':
+ True}]
+ fields = ['name', 'street', 'country.name']
+ data = session.find ('person', cond, order, fields)
+ for p in data:
+ print "%-35s|%-35s" % (p.name, p.country.name)
+
+ session.close ()
Property changes on: trunk/gnue-appserver/samples/testing/qualify.py
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: trunk/gnue-appserver/samples/testing/sorting.py
===================================================================
--- trunk/gnue-appserver/samples/testing/sorting.py 2005-03-13 08:45:12 UTC
(rev 7192)
+++ trunk/gnue-appserver/samples/testing/sorting.py 2005-03-13 10:03:11 UTC
(rev 7193)
@@ -41,8 +41,13 @@
session.setcontext ('address')
- #print "-" * 70
- #runFind (session, ['address_name'])
+ print "-" * 70
+ runFind (session, ['address_name'])
print "-" * 70
- runFind (session, [('address_nextmeeting', False), 'address_name'])
+ runFind (session, [('alwaystrue', False), ('address_name', True, True)])
+ print "-" * 70
+ runFind (session, ['address_name'])
+ print "-" * 70
+ runFind (session, ['zip', ('alwaystrue'),
+ {'name': 'name', 'ignorecase': True}])
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnue] r7193 - in trunk/gnue-appserver/samples: . testing,
johannes <=