Files
tjb-tech 5dd8b952ec Initial release: oh — OpenHarness: Open Agent Harness v0.1.0
A lightweight open-source Python implementation of the Agent Harness architecture.
44x lighter than Claude Code (11K vs 512K lines), 98% core tool coverage.

- 43 tools with Pydantic validation and parallel execution
- Skills system compatible with anthropics/skills (17+ tested)
- Plugin system compatible with claude-code/plugins (12+ tested)
- API retry with exponential backoff
- Multi-level permissions with path rules
- React/Ink TUI with "Oh my Harness!" branding
- 114 unit tests + 6 E2E test suites
- MIT License
2026-04-01 16:32:25 +00:00

70 lines
2.3 KiB
Python

"""Tests for openharness.config.paths."""
from __future__ import annotations
from pathlib import Path
from openharness.config.paths import (
get_config_dir,
get_config_file_path,
get_data_dir,
get_logs_dir,
)
def test_get_config_dir_default(tmp_path: Path, monkeypatch):
monkeypatch.delenv("OPENHARNESS_CONFIG_DIR", raising=False)
monkeypatch.setattr(Path, "home", classmethod(lambda cls: tmp_path))
config_dir = get_config_dir()
assert config_dir == tmp_path / ".openharness"
assert config_dir.is_dir()
def test_get_config_dir_env_override(tmp_path: Path, monkeypatch):
custom = tmp_path / "custom_config"
monkeypatch.setenv("OPENHARNESS_CONFIG_DIR", str(custom))
config_dir = get_config_dir()
assert config_dir == custom
assert config_dir.is_dir()
def test_get_config_file_path(tmp_path: Path, monkeypatch):
monkeypatch.delenv("OPENHARNESS_CONFIG_DIR", raising=False)
monkeypatch.setattr(Path, "home", classmethod(lambda cls: tmp_path))
path = get_config_file_path()
assert path == tmp_path / ".openharness" / "settings.json"
def test_get_data_dir_default(tmp_path: Path, monkeypatch):
monkeypatch.delenv("OPENHARNESS_CONFIG_DIR", raising=False)
monkeypatch.delenv("OPENHARNESS_DATA_DIR", raising=False)
monkeypatch.setattr(Path, "home", classmethod(lambda cls: tmp_path))
data_dir = get_data_dir()
assert data_dir == tmp_path / ".openharness" / "data"
assert data_dir.is_dir()
def test_get_data_dir_env_override(tmp_path: Path, monkeypatch):
custom = tmp_path / "custom_data"
monkeypatch.setenv("OPENHARNESS_DATA_DIR", str(custom))
data_dir = get_data_dir()
assert data_dir == custom
assert data_dir.is_dir()
def test_get_logs_dir_default(tmp_path: Path, monkeypatch):
monkeypatch.delenv("OPENHARNESS_CONFIG_DIR", raising=False)
monkeypatch.delenv("OPENHARNESS_LOGS_DIR", raising=False)
monkeypatch.setattr(Path, "home", classmethod(lambda cls: tmp_path))
logs_dir = get_logs_dir()
assert logs_dir == tmp_path / ".openharness" / "logs"
assert logs_dir.is_dir()
def test_get_logs_dir_env_override(tmp_path: Path, monkeypatch):
custom = tmp_path / "custom_logs"
monkeypatch.setenv("OPENHARNESS_LOGS_DIR", str(custom))
logs_dir = get_logs_dir()
assert logs_dir == custom
assert logs_dir.is_dir()