Improve random query generation
...throw in the occasional `NOT`
This commit is contained in:
parent
373616ad1e
commit
5b26a78c1f
|
@ -47,7 +47,9 @@ def generate_statement(conn, table, column_values, all_values):
|
||||||
if random.randint(0, 1) == 0:
|
if random.randint(0, 1) == 0:
|
||||||
values = all_values
|
values = all_values
|
||||||
value = values[random.randint(0, len(values) - 1)]
|
value = values[random.randint(0, len(values) - 1)]
|
||||||
query += field + ' ' + op + ' ' + str(value)
|
if random.randint(0, 5) == 0:
|
||||||
|
query += ' NOT '
|
||||||
|
query += '(' + field + ' ' + op + ' ' + str(value) + ')'
|
||||||
|
|
||||||
if random.randint(0, 3) == 0:
|
if random.randint(0, 3) == 0:
|
||||||
how_many = random.randint(0, 15)
|
how_many = random.randint(0, 15)
|
||||||
|
|
Loading…
Reference in New Issue