Changeset: 0cd7237840ab for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0cd7237840ab
Modified Files:
        sql/test/BugTracker-2012/Tests/currenttime.Bug-2781.py
Branch: Jan2014
Log Message:

Calculate current time to compare with as late as possible.
This way there should be a better chance of getting the desired answer
from the query.


diffs (40 lines):

diff --git a/sql/test/BugTracker-2012/Tests/currenttime.Bug-2781.py 
b/sql/test/BugTracker-2012/Tests/currenttime.Bug-2781.py
--- a/sql/test/BugTracker-2012/Tests/currenttime.Bug-2781.py
+++ b/sql/test/BugTracker-2012/Tests/currenttime.Bug-2781.py
@@ -4,12 +4,6 @@ try:
 except ImportError:
     import process
 
-
-currenttime = time.strftime('%H:%M:%S', time.localtime(time.time()))
-
-#SQL command for checking the localtime
-sqlcommand = "select (localtime() - time '%s' < time '00:00:20') and (time 
'%s' - localtime() < time '00:00:20');" %(currenttime, currenttime)
-
 def server_start():
     sys.stderr.write('#mserver\n')
     sys.stderr.flush()
@@ -17,17 +11,20 @@ def server_start():
                          stdout = process.PIPE, stderr = process.PIPE)
     return srv
 
-def client(lang, sqlCommand, user = 'monetdb', passwd = 'monetdb'):
+def client(lang, user = 'monetdb', passwd = 'monetdb'):
     sys.stderr.write('#client\n')
     sys.stderr.flush()
     clt = process.client(lang, user = user, passwd = passwd,
                          stdin = process.PIPE,
                          stdout = process.PIPE, stderr = process.PIPE)
-    return clt.communicate(sqlCommand)
+    currenttime = time.strftime('%H:%M:%S', time.localtime(time.time()))
+    #SQL command for checking the localtime
+    sqlcommand = "select (localtime() - time '%s' < time '00:00:20') and (time 
'%s' - localtime() < time '00:00:20');" % (currenttime, currenttime)
+    return clt.communicate(sqlcommand)
 
 def main():
     srv = server_start()
-    out, err = client('sql',sqlcommand)
+    out, err = client('sql')
 
     sys.stdout.write(out)
     sys.stderr.write(err)
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to