def test_main_address_from_slurm_node_list(slurm_node_list, expected):
    """Test extracting the main node from different formats for the SLURM_NODELIST."""
    with mock.patch.dict(os.environ, {"SLURM_NODELIST": slurm_node_list}):
        env = SLURMEnvironment()
        assert env.main_address == expected
Test extracting the main node from different formats for the SLURM_NODELIST.
tests/tests_fabric/plugins/environments/test_slurm.py