

def test_max_servers(self):
    logging.debug('')
    logging.debug('test_max_servers')
    (n_servers, criteria) = self.local.max_servers({
        'python_version': sys.version[:3],
        'min_cpus': 1,
    })
    try:
        n_cpus = multiprocessing.cpu_count()
    except (AttributeError, NotImplementedError):
        n_cpus = 1
    self.assertEqual(n_servers, n_cpus)
    (n_servers, criteria) = self.local.max_servers({
        'min_cpus': 1000,
    })
    self.assertEqual(n_servers, 0)
    (n_servers, criteria) = self.local.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_max_servers/original