Files
oh-my-pi/packages/coding-agent/test/core/settings-manager-python.test.ts
T
can1357 ef415e863b feat(coding-agent): refactored settings system with new singleton API and unified schema
- Replaced SettingsManager class with new Settings singleton providing synchronous get/set API and background persistence.
- Introduced settings-schema.ts as single source of truth for all configuration definitions with 100+ settings organized into logical groups.
- Migrated from method-based settings access (getTheme(), setTheme()) to path-based access using dot notation (settings.get('theme'), settings.set('theme', value)).
- Removed 2035-line settings-manager.ts file and replaced with modular settings.ts (693 lines) and settings-schema.ts (836 lines) for improved maintainability.
- Unified settings schema into single source of truth eliminating duplicate definitions across settings-defs.ts and settings-manager.ts.
2026-02-01 08:08:58 +01:00

25 lines
877 B
TypeScript

import { describe, expect, it } from "bun:test";
import { Settings } from "@oh-my-pi/pi-coding-agent/config/settings";
describe("Settings python settings", () => {
it("defaults to both and session", () => {
const settings = Settings.isolated({});
expect(settings.get("python.toolMode")).toBe("both");
expect(settings.get("python.kernelMode")).toBe("session");
});
it("persists python tool and kernel modes", () => {
const settings = Settings.isolated({});
settings.set("python.toolMode", "bash-only");
settings.set("python.kernelMode", "per-call");
expect(settings.get("python.toolMode")).toBe("bash-only");
expect(settings.get("python.kernelMode")).toBe("per-call");
const serialized = settings.serialize();
expect((serialized.python as any)?.toolMode).toBe("bash-only");
expect((serialized.python as any)?.kernelMode).toBe("per-call");
});
});