def test_cobalt_nodelist_seq(): os.environ["LIBE_RESOURCES_TEST_NODE_LIST"] = "9-12" exp_out = ['9', '10', '11', '12'] nodelist = EnvResources.get_cobalt_nodelist( node_list_env="LIBE_RESOURCES_TEST_NODE_LIST") assert nodelist == exp_out, "Nodelist returned does not match expected"
def test_cobalt_nodelist_reverse_grp(): os.environ["LIBE_RESOURCES_TEST_NODE_LIST"] = "20-22,139-137,1234" exp_out = ['20', '21', '22', '137', '138', '139', '1234'] nodelist = EnvResources.get_cobalt_nodelist( node_list_env="LIBE_RESOURCES_TEST_NODE_LIST") assert nodelist == exp_out, "Nodelist returned does not match expected"
def test_cobalt_nodelist_single(): os.environ["LIBE_RESOURCES_TEST_NODE_LIST"] = "56" exp_out = ["56"] nodelist = EnvResources.get_cobalt_nodelist( node_list_env="LIBE_RESOURCES_TEST_NODE_LIST") assert nodelist == exp_out, "Nodelist returned does not match expected"