1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-08 14:22:09 +03:00

feat/MCOL-6074: CMAPI integrational tests that work with real hosts (using columnstore-ansible-aws for cluster creation/provisioning)

This commit is contained in:
Alexander Presnyakov
2025-05-20 04:07:04 +00:00
parent 59a19aaa88
commit d3fafe6241
12 changed files with 641 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
from contextlib import contextmanager
import os
@contextmanager
def change_directory(new_dir):
"""
Context manager for temporarily changing the current working directory.
Args:
new_dir: Directory to change to
Example:
with change_directory("/path/to/dir"):
# Code here runs with the working directory as "/path/to/dir"
# After the block, we return to the original directory
"""
old_dir = os.getcwd()
try:
os.chdir(new_dir)
yield
finally:
os.chdir(old_dir)
def drop_timestamp(data: dict) -> dict:
"""
Drop the timestamp from the data dictionary.
"""
if "timestamp" in data:
del data["timestamp"]
return data
def assert_dict_includes(this: dict, other: dict) -> None:
"""
Check if the current dictionary includes all keys and values from another dictionary.
"""
for key, value in other.items():
assert key in this
assert this[key] == value, f"Key '{key}' does not match: {this[key]} != {value}"