def METHOD_NAME():
    """
    Test the etcd_mod.directory state function
    """
    get_mock = MagicMock()
    set_mock = MagicMock()
    dunder_salt = {
        "etcd.get": get_mock,
        "etcd.set": set_mock,
    }
    with patch.dict(etcd_state.__salt__, dunder_salt):
        # Test new directory creation
        get_mock.return_value = None
        set_mock.return_value = "new_dir"
        expected = {
            "name": "new_dir",
            "comment": "New directory created",
            "result": True,
            "changes": {"new_dir": "Created"},
        }
        assert etcd_state.directory("new_dir", profile="test") == expected
        # Test creating an existing directory
        get_mock.return_value = "new_dir"
        set_mock.return_value = "new_dir"
        expected = {
            "name": "new_dir",
            "comment": "Directory exists",
            "result": True,
            "changes": {},
        }
        assert etcd_state.directory("new_dir", profile="test") == expected