Commit 33ccec0b authored by Aurel's avatar Aurel Committed by Arnaud Fontaine

fix sqltest patch

parent d63a5f9d
...@@ -51,7 +51,7 @@ if 1: # For easy diff with original ...@@ -51,7 +51,7 @@ if 1: # For easy diff with original
if type(v) is StringType: if type(v) is StringType:
if v[-1:]=='L': if v[-1:]=='L':
v=v[:-1] v=v[:-1]
atoi(v) int(v)
else: v=str(int(v)) else: v=str(int(v))
except ValueError: except ValueError:
raise ValueError( raise ValueError(
...@@ -59,7 +59,7 @@ if 1: # For easy diff with original ...@@ -59,7 +59,7 @@ if 1: # For easy diff with original
elif t=='float': elif t=='float':
if not v and type(v) is StringType: continue if not v and type(v) is StringType: continue
try: try:
if type(v) is StringType: atof(v) if type(v) is StringType: float(v)
else: v=str(float(v)) else: v=str(float(v))
except ValueError: except ValueError:
raise ValueError( raise ValueError(
...@@ -104,4 +104,11 @@ if 1: # For easy diff with original ...@@ -104,4 +104,11 @@ if 1: # For easy diff with original
return "%s %s %s" % (self.column, self.op, vs[0]) return "%s %s %s" % (self.column, self.op, vs[0])
SQLTest.render = SQLTest.__call__ = render SQLTest.render = SQLTest.__call__ = render
sqltest.valid_type = (('int', 'float', 'string', 'nb', 'datetime') + tuple('datetime(%s)' % x for x in xrange(7))).__contains__ new_valid_types = (('int', 'float', 'string', 'nb', 'datetime') + tuple('datetime(%s)' % x for x in xrange(7)))
try:
# BBB
from Shared.DC.ZRDB.sqltest import valid_type
sqltest.valid_type = new_valid_types.__contains__
except ImportError:
sqltest.valid_types = new_valid_types
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment