mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-04 14:03:06 +00:00
So far for UpdateItem we only supported the old-style AttributeUpdates parameter, not the newer UpdateExpression. This patch begins the path to supporting UpdateExpression. First, trying to use *both* parameters should result in an error, and this patch does this (and tests this). Second, passing neither parameters is allowed, and should result in an *empty* item being created. Finally, since today we do not yet support UpdateExpression, this patch will cause UpdateItem to fail if UpdateExpression is used, instead of silently being ignored as we did so far. Signed-off-by: Nadav Har'El <nyh@scylladb.com>
Tests for Alternator that should also pass, identically, against DynamoDB.
Tests use the boto3 library for AWS API, and the pytest frameworks (both are available from Linux distributions, or with "pip install").
The files ~/.aws/credentials should be configure with your AWS key:
[default]
aws_access_key_id = XXXXXXXXXXXXXXXXXXXX
aws_secret_access_key = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
and ~/.aws/config with the default region to use in the test:
[default]
region = us-east-1
- Running "pytest" runs all tests.
- To run all tests in a single file, do
pytest test_table.py. - To run a single specific test, do
pytest test_table.py::test_create_table_unsupported_names. - To run tests against a local Scylla installation at http://localhost:8000, add "--local".
For example -
pytest --local test_item.pyorpytest --local. - Additional useful pytest options, especially useful for debugging tests:
- -v: show the names of each individual test running instead of just dots.
- -s: show the full output of running tests (by default, pytest captures the test's output and only displays it if a test fails)