Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add test for partial cell data #908

Merged
merged 1 commit into from
Dec 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions tests/unit/test_row_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,30 @@ def test__retry_read_rows_exception_deadline_exceeded_wrapped_in_grpc():
assert _retry_read_rows_exception(exception)


def test_partial_cell_data():
from google.cloud.bigtable.row_data import PartialCellData

expected_key = b"row-key"
expected_family_name = b"family-name"
expected_qualifier = b"qualifier"
expected_timestamp = 1234
instance = PartialCellData(
expected_key, expected_family_name, expected_qualifier, expected_timestamp
)
assert instance.row_key == expected_key
assert instance.family_name == expected_family_name
assert instance.qualifier == expected_qualifier
assert instance.timestamp_micros == expected_timestamp
assert instance.value == b""
assert instance.labels == ()
# test updating value
added_value = b"added-value"
instance.append_value(added_value)
assert instance.value == added_value
instance.append_value(added_value)
assert instance.value == added_value + added_value


def _make_partial_rows_data(*args, **kwargs):
from google.cloud.bigtable.row_data import PartialRowsData

Expand Down
Loading