From da7e87dc5666d4bb35b3cb1f030246e390f31dfd Mon Sep 17 00:00:00 2001 From: Piotr Sarna Date: Mon, 21 Dec 2020 19:00:47 +0100 Subject: [PATCH] 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: --- test/cql-pytest/test_using_timeout.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/cql-pytest/test_using_timeout.py b/test/cql-pytest/test_using_timeout.py index b0c1b0bef5..d2f9e4fba7 100644 --- a/test/cql-pytest/test_using_timeout.py +++ b/test/cql-pytest/test_using_timeout.py @@ -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):