Skip to content

Commit

Permalink
Check for specific exception.
Browse files Browse the repository at this point in the history
  • Loading branch information
daspecster committed Dec 29, 2016
1 parent 878fb58 commit dc49e57
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bigtable/google/cloud/bigtable/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"""Scope for reading table data."""

# NOTE: 'grpc.max_message_length' will no longer be recognized in
# grpcio 1.1 and later.
# grpcio 1.1 and later.
_MAX_MSG_LENGTH_100MB = 100 * 1024 * 1024
_GRPC_MAX_LENGTH_OPTIONS = (
('grpc.max_message_length', _MAX_MSG_LENGTH_100MB),
Expand Down
10 changes: 5 additions & 5 deletions system_tests/bigtable.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
from google.cloud.bigtable.row_data import Cell
from google.cloud.bigtable.row_data import PartialRowData
from google.cloud.environment_vars import BIGTABLE_EMULATOR
from grpc._channel import _Rendezvous

from retry import RetryErrors
from retry import RetryResult
Expand Down Expand Up @@ -378,23 +379,22 @@ def test_read_large_cells_over_limit(self):
row = self._table.row(ROW_KEY)
self.rows_to_delete.append(row)

data = '1' * 51 * 1024 * 1024 # 51MB.
data = b'1' * 51 * 1024 * 1024 # 51MB.
row.set_cell(COLUMN_FAMILY_ID1, COL_NAME1, data)
row.commit()
row.set_cell(COLUMN_FAMILY_ID1, COL_NAME1, data)
row.commit()

with self.assertRaises(Exception):
with self.assertRaises(_Rendezvous):
partial_row_data = self._table.read_row(ROW_KEY)


def test_read_large_cell_over_limit(self):
row = self._table.row(ROW_KEY)
self.rows_to_delete.append(row)

data = '1' * 101 * 1024 * 1024 # 11MB of 1's.
data = b'1' * 101 * 1024 * 1024 # 101MB of 1's.
row.set_cell(COLUMN_FAMILY_ID1, COL_NAME1, data)
with self.assertRaises(Exception):
with self.assertRaises(_Rendezvous):
row.commit()

def test_read_row(self):
Expand Down

0 comments on commit dc49e57

Please sign in to comment.