test: add cases for using timeout with bind markers

The test suite for USING TIMEOUT already included binding
the timeout value, but only for wildcard (?). The test case
is now extended with named bind markers.

Tests: unit(dev)
Message-Id: <b5344f40d26d90b36e90a04c2474127728535eaa.1608573624.git.sarna@scylladb.com>
This commit is contained in:
Piotr Sarna
2020-12-21 19:00:47 +01:00
committed by Pekka Enberg
parent 961b9e8390
commit da7e87dc56

View File

@@ -73,6 +73,11 @@ def test_prepared_statements(scylla_only, cql, table1):
with pytest.raises(WriteTimeout):
cql.execute(prep, (Duration(nanoseconds=0), 3, 42))
cql.execute(prep, (Duration(nanoseconds=10**15), 3, 42))
prep_named = cql.prepare(f"UPDATE {table} USING TIMEOUT :timeout AND TIMESTAMP :ts SET v = :v WHERE p = 9 and c = 1")
# Timeout cannot be left unbound
with pytest.raises(InvalidRequest):
cql.execute(prep_named, {'timestamp': 42, 'v': 3})
cql.execute(prep_named, {'timestamp': 42, 'v': 3, 'timeout': Duration(nanoseconds=10**15)})
# Mixing TIMEOUT parameter with other params from the USING clause is legal
def test_mix_per_query_timeout_with_other_params(scylla_only, cql, table1):