

def test_cluster(self):
    logging.debug('')
    logging.debug('test_cluster')
    if self.skip_ssh:
        logging.debug('    requires ssh, skipping')
        return
    self.cluster = ClusterAllocator(self.name, self.machines)
    self.assertEqual(len(self.cluster), len(self.machines))
    (n_servers, criteria) = self.cluster.max_servers({
        'python_version': sys.version[:3],
    })
    try:
        n_cpus = multiprocessing.cpu_count()
    except (AttributeError, NotImplementedError):
        n_cpus = 1
    self.assertEqual(n_servers, (len(self.cluster) * n_cpus))
    (n_servers, criteria) = self.cluster.max_servers({
        'python_version': '2.999',
    })
    self.assertEqual(n_servers, 0)

dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.main/src/openmdao/main/test/test_resource.py TestCase.test_cluster/original