From 4f427167ac4967e079f5e5a2dd27538fef1dcd45 Mon Sep 17 00:00:00 2001 From: kshitij <82637225+kshitijk4poor@users.noreply.github.com> Date: Thu, 12 Mar 2026 02:49:29 +0530 Subject: [PATCH] chore: clean OpenClaw migration follow-up --- hermes_cli/setup.py | 13 +++++++++---- tests/hermes_cli/test_setup_openclaw_migration.py | 8 +++----- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/hermes_cli/setup.py b/hermes_cli/setup.py index b53b0bf0..69029545 100644 --- a/hermes_cli/setup.py +++ b/hermes_cli/setup.py @@ -12,7 +12,6 @@ Config files are stored in ~/.hermes/ for easy access. """ import importlib.util -import json import logging import os import sys @@ -2084,8 +2083,12 @@ def setup_tools(config: dict, first_install: bool = False): _OPENCLAW_SCRIPT = ( - PROJECT_ROOT / "optional-skills" / "migration" - / "openclaw-migration" / "scripts" / "openclaw_to_hermes.py" + PROJECT_ROOT + / "optional-skills" + / "migration" + / "openclaw-migration" + / "scripts" + / "openclaw_to_hermes.py" ) @@ -2108,7 +2111,9 @@ def _offer_openclaw_migration(hermes_home: Path) -> bool: print() if not prompt_yes_no("Would you like to import from OpenClaw?", default=True): - print_info("Skipping migration. You can run it later via the openclaw-migration skill.") + print_info( + "Skipping migration. You can run it later via the openclaw-migration skill." + ) return False # Ensure config.yaml exists before migration tries to read it diff --git a/tests/hermes_cli/test_setup_openclaw_migration.py b/tests/hermes_cli/test_setup_openclaw_migration.py index aa93eb5c..98c830b4 100644 --- a/tests/hermes_cli/test_setup_openclaw_migration.py +++ b/tests/hermes_cli/test_setup_openclaw_migration.py @@ -1,12 +1,9 @@ """Tests for OpenClaw migration integration in the setup wizard.""" from argparse import Namespace -from pathlib import Path from types import ModuleType from unittest.mock import MagicMock, patch -import pytest - from hermes_cli import setup as setup_mod @@ -145,7 +142,7 @@ class TestOfferOpenclawMigration: patch.object(setup_mod, "_OPENCLAW_SCRIPT", script), patch.object(setup_mod, "prompt_yes_no", return_value=True), patch.object(setup_mod, "get_config_path", return_value=config_path), - patch.object(setup_mod, "load_config", return_value={"agent": {}}) as mock_load, + patch.object(setup_mod, "load_config", return_value={"agent": {}}), patch.object(setup_mod, "save_config") as mock_save, patch( "importlib.util.spec_from_file_location", @@ -242,7 +239,8 @@ class TestSetupWizardOpenclawIntegration: patch.object(setup_mod, "load_config", return_value={}), patch.object(setup_mod, "get_hermes_home", return_value=tmp_path), patch.object( - setup_mod, "get_env_value", + setup_mod, + "get_env_value", side_effect=lambda k: "sk-xxx" if k == "OPENROUTER_API_KEY" else "", ), patch("hermes_cli.auth.get_active_provider", return_value=None),