Update of /cvsroot/monetdb/sql/src/test/Dump/Tests
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv20774/src/test/Dump/Tests

Modified Files:
      Tag: Nov2009
        dump.SQL.py reload.SQL.py 
Log Message:
New module MonetDBtesting.process to make it easier to write tests in Python.

U dump.SQL.py
Index: dump.SQL.py
===================================================================
RCS file: /cvsroot/monetdb/sql/src/test/Dump/Tests/dump.SQL.py,v
retrieving revision 1.3.4.2
retrieving revision 1.3.4.3
diff -u -d -r1.3.4.2 -r1.3.4.3
--- dump.SQL.py 12 Oct 2009 15:36:21 -0000      1.3.4.2
+++ dump.SQL.py 15 Oct 2009 15:50:54 -0000      1.3.4.3
@@ -1,17 +1,10 @@
 import os, sys
-import subprocess
-
-TSTTRGDIR = os.environ['TSTTRGDIR']
-SQLDUMP = os.environ['SQLDUMP']
-MAPIPORT = os.environ['MAPIPORT']
+from MonetDBtesting import process
 
-p = subprocess.Popen('%s -p %s' % (SQLDUMP, MAPIPORT),
-                     shell = True,
-                     universal_newlines = True,
-                     stdout = subprocess.PIPE)
+p = process.client('sqldump', stdout = process.PIPE)
 dump, err = p.communicate()
 
-f = open(os.path.join(TSTTRGDIR, 'dumpoutput.sql'), 'w')
+f = open(os.path.join(os.environ['TSTTRGDIR'], 'dumpoutput.sql'), 'w')
 f.write(dump)
 f.close()
 

U reload.SQL.py
Index: reload.SQL.py
===================================================================
RCS file: /cvsroot/monetdb/sql/src/test/Dump/Tests/reload.SQL.py,v
retrieving revision 1.6.2.2
retrieving revision 1.6.2.3
diff -u -d -r1.6.2.2 -r1.6.2.3
--- reload.SQL.py       14 Oct 2009 08:22:38 -0000      1.6.2.2
+++ reload.SQL.py       15 Oct 2009 15:50:54 -0000      1.6.2.3
@@ -1,19 +1,13 @@
 import os, sys
-import subprocess
+from MonetDBtesting import process
 
 def main():
-    TSTTRGDIR = os.environ['TSTTRGDIR']
-    SQLCLIENT = os.environ['SQLCLIENT']
-    MAPIPORT = os.environ['MAPIPORT']
-
-    cmd = str('%s -umonetdb -Pmonetdb -p %s' % (SQLCLIENT, MAPIPORT))
-    f = open(os.path.join(TSTTRGDIR, 'dumpoutput.sql'), 'r')
-    clt = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE,
-                           stdin=subprocess.PIPE, stderr=subprocess.PIPE)
-    out, err = clt.communicate(f.read())
-    f.close()
+    clt = process.client('sql', user = 'monetdb', passwd = 'monetdb',
+                         stdin = open(os.path.join(os.environ['TSTTRGDIR'],
+                                                   'dumpoutput.sql'), 'r'),
+                         stdout = process.PIPE, stderr = process.PIPE)
+    out, err = clt.communicate()
     sys.stdout.write(out)
     sys.stderr.write(err)
 
-
 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

Reply via email to