Skip to content

Commit

Permalink
added missing cover test
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-sanche committed Dec 14, 2023
1 parent 105aea0 commit 9162eaf
Showing 1 changed file with 24 additions and 0 deletions.
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

0 comments on commit 9162eaf

Please sign in to comment.