def _list_tables_helper(self, table_name=None):
        from google.cloud.bigtable._generated import (
            table_pb2 as table_data_v2_pb2)
        from google.cloud.bigtable._generated import (
            bigtable_table_admin_pb2 as table_messages_v1_pb2)
        from unit_tests._testing import _FakeStub

        client = _Client(self.PROJECT)
        instance = self._make_one(self.INSTANCE_ID, client, self.LOCATION_ID)

        # Create request_
        request_pb = table_messages_v1_pb2.ListTablesRequest(
            parent=self.INSTANCE_NAME)

        # Create response_pb
        if table_name is None:
            table_name = self.TABLE_NAME

        response_pb = table_messages_v1_pb2.ListTablesResponse(
            tables=[
                table_data_v2_pb2.Table(name=table_name),
            ],
        )

        # Patch the stub used by the API method.
        client._table_stub = stub = _FakeStub(response_pb)

        # Create expected_result.
        expected_table = instance.table(self.TABLE_ID)
        expected_result = [expected_table]

        # Perform the method and check the result.
        result = instance.list_tables()

        self.assertEqual(result, expected_result)
        self.assertEqual(stub.method_calls, [(
            'ListTables',
            (request_pb,),
            {},
        )])
    def list_tables(self):
        """List the tables in this instance.

        :rtype: list of :class:`Table <google.cloud.bigtable.table.Table>`
        :returns: The list of tables owned by the instance.
        :raises: :class:`ValueError <exceptions.ValueError>` if one of the
                 returned tables has a name that is not of the expected format.
        """
        request_pb = table_messages_v2_pb2.ListTablesRequest(parent=self.name)
        # We expect a `table_messages_v2_pb2.ListTablesResponse`
        table_list_pb = self._client._table_stub.ListTables(request_pb)

        result = []
        for table_pb in table_list_pb.tables:
            table_prefix = self.name + '/tables/'
            if not table_pb.name.startswith(table_prefix):
                raise ValueError('Table name %s not of expected format' %
                                 (table_pb.name, ))
            table_id = table_pb.name[len(table_prefix):]
            result.append(self.table(table_id))

        return result