def test_parseSLURM_dashTwonames(self): hosts = utils.parseSLURM("x[1-2]y[1-2]") result = [] for num in range(1, 3): for prefix in ["x", "y"]: result.append(("{prefix}{num}".format(**locals()), 1)) self.assertEqual(set(hosts), set(result))
def test_parseSLURM_dashTwoDecimals(self): hosts = utils.parseSLURM("n[5-10]") result = zip(("n{0:02d}".format(x) for x in range(5, 11)), repeat(1)) self.assertEqual(set(hosts), set(result))
def test_parseSLURM_dashOneDecimal(self): hosts = utils.parseSLURM("n[1-4]") result = zip(("n{0}".format(x) for x in range(1, 5)), repeat(1)) self.assertEqual(set(hosts), set(result))
def test_parseSLURM_nondashOneDecimal(self): hosts = utils.parseSLURM("n[1,4]") result = [] result = zip(("n{0}".format(x) for x in [1, 4]), repeat(1)) self.assertEqual(set(hosts), set(result))