

def _helper(self, timeout=None, clusters=(), failed_zones=()):
    from functools import partial
    from gcloud._testing import _Monkey
    from gcloud.bigtable.happybase import connection as MUT
    client_with_clusters = partial(_Client, clusters=clusters, failed_zones=failed_zones)
    with _Monkey(MUT, Client=client_with_clusters):
        result = self._callFUT(timeout=timeout)
    (cluster,) = clusters
    self.assertEqual(result, cluster)
    client = self.client
    self.assertEqual(client.args, ())
    expected_kwargs = {
        'admin': True,
    }
    if (timeout is not None):
        expected_kwargs['timeout_seconds'] = (timeout / 1000.0)
    self.assertEqual(client.kwargs, expected_kwargs)
    self.assertEqual(client.start_calls, 1)
    self.assertEqual(client.stop_calls, 1)

dataset/ETHPy150Open GoogleCloudPlatform/gcloud-python/gcloud/bigtable/happybase/test_connection.py Test__get_cluster._helper/VarMisuse@104/140 `cluster`->`self`