Skip to content

Commit

Permalink
ref: match signatures in mocked bigtable implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
asottile-sentry committed Jul 23, 2024
1 parent 7f1026a commit 71bbc10
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions tests/sentry/nodestore/bigtable/test_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,23 @@ def __init__(self):
def direct_row(self, key):
return MockedBigtableKVStorage.Row(self, key)

def read_row(self, key):
return MockedBigtableKVStorage.Row(self, key)

def read_rows(self, row_set):
def read_row(self, row_key, filter_=None):
return MockedBigtableKVStorage.Row(self, row_key)

def read_rows(
self,
start_key=None,
end_key=None,
limit=None,
filter_=None,
end_inclusive=False,
row_set=None,
retry=None,
):
assert not row_set.row_ranges, "unsupported"
return [self.read_row(key) for key in row_set.row_keys]

def mutate_rows(self, rows):
def mutate_rows(self, rows, retry=None, timeout=None):
# commits not implemented, changes are applied immediately
return [Status(code=0) for row in rows]

Expand All @@ -65,7 +74,7 @@ def _get_table(self, admin: bool = False):

return table

def bootstrap(self, automatic_expiry):
def bootstrap(self) -> None:
pass


Expand Down Expand Up @@ -98,6 +107,7 @@ def ns(request):
yield MockedBigtableNodeStorage(project="test")


@pytest.mark.django_db
def test_cache(ns):
node_1 = ("a" * 32, {"foo": "a"})
node_2 = ("b" * 32, {"foo": "b"})
Expand Down

0 comments on commit 71bbc10

Please sign in to comment.