

def test_constructor_missing_cluster(self):
    from gcloud._testing import _Monkey
    from gcloud.bigtable.happybase import connection as MUT
    cluster = _Cluster()
    timeout = object()
    get_cluster_called = []

    def mock_get_cluster(timeout):
        get_cluster_called.append(timeout)
        return cluster
    with _Monkey(MUT, _get_cluster=mock_get_cluster):
        connection = self._makeOne(autoconnect=False, cluster=None, timeout=timeout)
        self.assertEqual(connection.table_prefix, None)
        self.assertEqual(connection.table_prefix_separator, '_')
        self.assertEqual(connection._cluster, cluster)
    self.assertEqual(get_cluster_called, [cluster])

dataset/ETHPy150Open GoogleCloudPlatform/gcloud-python/gcloud/bigtable/happybase/test_connection.py TestConnection.test_constructor_missing_cluster/VarMisuse@137/186 `timeout`->`cluster`