def METHOD_NAME(self, _create_macros_cmake):
    case_mock = mock.MagicMock()
    machine_mock = mock.MagicMock()
    machine_mock.get_machine_name.return_value = "test"
    # create context stack to cleanup after test
    with contextlib.ExitStack() as stack:
        root_path = stack.enter_context(create_machines_dir())
        case_path = stack.enter_context(tempfile.TemporaryDirectory())
        cmake_macros_path = os.path.join(root_path, "machines", "cmake_macros")
        case_mock.get_value.return_value = cmake_macros_path
        machines_path = os.path.join(root_path, "machines")
        type(machine_mock).machines_dir = mock.PropertyMock(
            return_value=machines_path
        )
        # do not generate env_mach_specific.xml
        Path(os.path.join(case_path, "env_mach_specific.xml")).touch()
        case_setup._create_macros(
            case_mock,
            machine_mock,
            case_path,
            "gnu-test",
            "openmpi",
            False,
            "mct",
            "LINUX",
        )
        case_mock.get_value.assert_any_call("CMAKE_MACROS_DIR")
        # make sure we're calling everything from within the case root
        stack.enter_context(chdir(case_path))
        _create_macros_cmake.assert_called_with(
            case_path,
            cmake_macros_path,
            machine_mock,
            "gnu-test",
            os.path.join(case_path, "cmake_macros"),
        )