Update of /cvsroot/monetdb/sql/src/test/mapi/Tests
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv20774/src/test/mapi/Tests
Modified Files:
Tag: Nov2009
utf8test.SQL.py
Log Message:
New module MonetDBtesting.process to make it easier to write tests in Python.
U utf8test.SQL.py
Index: utf8test.SQL.py
===================================================================
RCS file: /cvsroot/monetdb/sql/src/test/mapi/Tests/utf8test.SQL.py,v
retrieving revision 1.4.6.1
retrieving revision 1.4.6.2
diff -u -d -r1.4.6.1 -r1.4.6.2
--- utf8test.SQL.py 12 Oct 2009 15:36:23 -0000 1.4.6.1
+++ utf8test.SQL.py 15 Oct 2009 15:50:56 -0000 1.4.6.2
@@ -1,24 +1,23 @@
import os, sys
-import subprocess
+from MonetDBtesting import process
-def client(cmd):
- clt = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
- sys.stdout.write(clt.stdout.read())
- clt.stdout.close()
- sys.stderr.write(clt.stderr.read())
- clt.stderr.close()
+def client(args):
+ clt = process.client('sql', args = args,
+ stdout = process.PIPE, stderr = process.PIPE)
+ out, err = clt.communicate()
+ sys.stdout.write(out)
+ sys.stderr.write(err)
def main():
- mclient = os.getenv('SQL_CLIENT')
- client('%s -s "create table utf8test (s varchar(50))"' % mclient)
- client('%s -s "insert into utf8test values (\'value without special
characters\')"' % mclient)
- client('%s -s "insert into utf8test values (\'funny characters:
\303\240\303\241\303\242\303\243\303\244\303\245\')"' % mclient)
- client('%s -fraw -s "select * from utf8test"' % mclient)
- client('%s -fsql -s "select * from utf8test"' % mclient)
- client('%s -fraw -Eiso-8859-1 -s "select * from utf8test"' % mclient)
- client('%s -fsql -Eiso-8859-1 -s "select * from utf8test"' % mclient)
- client('%s -fraw -Eus-ascii -s "select * from utf8test"' % mclient)
- client('%s -fsql -Eus-ascii -s "select * from utf8test"' % mclient)
- client('%s -s "drop table utf8test"' % mclient)
+ client(['-s', 'create table utf8test (s varchar(50))'])
+ client(['-s', "insert into utf8test values ('value without special
characters')"])
+ client(['-s', "insert into utf8test values ('funny characters:
\303\240\303\241\303\242\303\243\303\244\303\245')"])
+ client(['-fraw', '-s', 'select * from utf8test'])
+ client(['-fsql', '-s', 'select * from utf8test'])
+ client(['-fraw', '-Eiso-8859-1', '-s', 'select * from utf8test'])
+ client(['-fsql', '-Eiso-8859-1', '-s', 'select * from utf8test'])
+ client(['-fraw', '-Eus-ascii', '-s', 'select * from utf8test'])
+ client(['-fsql', '-Eus-ascii', '-s', 'select * from utf8test'])
+ client(['-s', 'drop table utf8test'])
main()
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins