Skip to main content
Glama
irskep

persistproc

by irskep
test_labels_simple.py1.69 kB
from pathlib import Path from tests.helpers import extract_json, run_cli COUNTER_SCRIPT = Path(__file__).parent / "scripts" / "counter.py" def test_start_process_with_default_label(server): """Test starting a process without custom label gets default label.""" # Start process without label start_cmd = f"python3 {COUNTER_SCRIPT} --num-iterations 3" start = run_cli("start", start_cmd) data = extract_json(start.stdout) # Verify we got a successful start assert data.get("error") is None assert data.get("pid") is not None # Verify label field exists and has expected format assert "label" in data assert data["label"] is not None assert " in " in data["label"] assert "python3" in data["label"] # Clean up pid = data["pid"] run_cli("stop", str(pid)) def test_start_process_with_custom_label(server): """Test starting a process with a custom label.""" # Start process with custom label (using full command string) start_cmd = f"python3 {COUNTER_SCRIPT} --num-iterations 3" start = run_cli("start", "--label", "my-test-label", start_cmd) data = extract_json(start.stdout) # Verify we got a successful start assert data.get("error") is None assert data.get("pid") is not None # Verify the custom label is returned assert data["label"] == "my-test-label" # Verify it appears in list with the custom label listed = run_cli("list") info = extract_json(listed.stdout) procs = info["processes"] pid = data["pid"] match = next(p for p in procs if p["pid"] == pid) assert match["label"] == "my-test-label" # Clean up run_cli("stop", str(pid))

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/irskep/persistproc'

If you have feedback or need assistance with the MCP directory API, please join our Discord server