repo stringclasses 454
values | file_path stringlengths 5 201 | extension stringclasses 1
value | content stringlengths 8 509k | num_lines int64 3 16.9k | size_bytes int64 8 511k |
|---|---|---|---|---|---|
gpt-pilot | tests/config/test_config.py | .py | import codecs
import json
from os.path import dirname, join
import pytest
from pydantic import ValidationError
from core.config import Config, ConfigLoader, LLMProvider, get_config, loader
test_config_data = {
"llm": {
"openai": {
"base_url": "https://api.openai.com/v1",
"api_key"... | 131 | 3,800 |
gpt-pilot | tests/config/test_version.py | .py | from os.path import dirname, join
from subprocess import check_output
from unittest.mock import patch
from core.config.version import get_git_commit, get_package_version, get_version
def test_get_package_version():
with open(join(dirname(__file__), "..", "..", "pyproject.toml"), "r", encoding="utf-8") as f:
... | 27 | 893 |
gpt-pilot | tests/config/test_env_importer.py | .py | from core.config import LLMProvider
from core.config.env_importer import convert_config
def test_convert_config():
values = {
"ENDPOINT": "OPENAI",
"OPENAI_ENDPOINT": "",
"OPENAI_API_KEY": "",
"AZURE_API_KEY": "",
"AZURE_ENDPOINT": "",
"OPENROUTER_API_KEY": "",
... | 81 | 2,553 |
gpt-pilot | tests/cli/test_cli.py | .py | import json
from argparse import ArgumentParser, ArgumentTypeError
from datetime import datetime
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from core.cli.helpers import (
init,
list_projects_branches_states,
list_projects_json,
load_config,
load_project,
parse_argument... | 355 | 11,521 |
gpt-pilot | tests/templates/test_templates.py | .py | from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from core.state.state_manager import StateManager
from core.templates.registry import PROJECT_TEMPLATES
@pytest.mark.skip
@pytest.mark.asyncio
@patch("core.state.state_manager.get_config")
async def test_render_react_express_sql(mock_get_config, te... | 81 | 2,571 |
gpt-pilot | tests/db/test_project_state.py | .py | import pytest
from sqlalchemy import select
from core.db.models import Branch, File, FileContent, Project, ProjectState
from core.db.models.project_state import IterationStatus
from .factories import create_project_state
@pytest.mark.asyncio
async def test_get_by_id(testdb):
state = create_project_state()
t... | 222 | 6,628 |
gpt-pilot | tests/db/test_branch.py | .py | from uuid import uuid4
import pytest
from core.db.models import Branch, Project
from .factories import create_project_state
@pytest.mark.asyncio
async def test_get_by_id_requires_valid_uuid(testdb):
with pytest.raises(ValueError):
await Branch.get_by_id(testdb, "invalid-uuid")
@pytest.mark.asyncio
as... | 69 | 1,687 |
gpt-pilot | tests/db/test_project.py | .py | import json
from datetime import datetime
from unittest.mock import AsyncMock, MagicMock, patch
from uuid import uuid4
import pytest
from core.cli.helpers import list_projects_json
from core.db.models import Branch, Project
from core.state.state_manager import StateManager
from .factories import create_project_state... | 157 | 4,296 |
gpt-pilot | tests/db/factories.py | .py | from core.db.models import Branch, Project, ProjectState
def create_project_state(project_name="Test Project", branch_name=Branch.DEFAULT):
"""
Create a test Project, Branch, Specification and ProjectState objects.
The objects are created as transient objects, so they need to be added
to a session be... | 19 | 671 |
gpt-pilot | tests/db/test_db.py | .py | import pytest
from sqlalchemy import func, select
from core.config import DBConfig
from core.db.models import Project, ProjectState
from core.db.setup import run_migrations
from .factories import create_project_state
def test_migrations(tmp_path):
db_cfg = DBConfig(url=f"sqlite+aiosqlite:///{tmp_path}/test.db")... | 67 | 2,033 |
gpt-pilot | tests/ui/test_console.py | .py | from unittest.mock import AsyncMock, patch
import pytest
from core.ui.base import AgentSource, UIClosedError
from core.ui.console import PlainConsoleUI
@pytest.mark.asyncio
async def test_send_message(capsys):
src = AgentSource("Product Owner", "product-owner")
ui = PlainConsoleUI()
connected = await u... | 89 | 2,445 |
gpt-pilot | tests/ui/test_ipc_client.py | .py | import asyncio
import json
import sys
import pytest
from core.config import LocalIPCConfig
from core.ui.base import AgentSource, UIClosedError
from core.ui.ipc_client import IPCClientUI
if sys.platform == "win32":
pytest.skip(
"Skipping IPC Client tests on Windows due to mock server timeouts",
al... | 304 | 8,672 |
gpt-pilot | tests/agents/test_convo.py | .py | from unittest.mock import MagicMock
from pydantic import BaseModel, Field
from core.agents.convo import AgentConvo
def test_init():
"""Test that init stores the agent instance and adds a system message."""
agent = MagicMock(agent_type="spec-writer", current_state=None)
convo = AgentConvo(agent)
ass... | 44 | 1,252 |
gpt-pilot | tests/agents/test_tech_lead.py | .py | import asyncio
import pytest
from core.agents.response import ResponseType
from core.agents.tech_lead import DevelopmentPlan, Epic, TechLead
from core.db.models import Complexity
from core.ui.base import UserInput
@pytest.mark.asyncio
async def test_create_initial_epic(agentcontext):
"""
If there are no epi... | 123 | 3,673 |
gpt-pilot | tests/agents/test_orchestrator.py | .py | from unittest.mock import AsyncMock, Mock
import pytest
from core.agents.orchestrator import Orchestrator
@pytest.mark.asyncio
async def test_offline_changes_check_restores_if_workspace_empty():
sm = AsyncMock()
sm.workspace_is_empty = Mock(return_value=False)
ui = AsyncMock()
orca = Orchestrator(st... | 101 | 3,151 |
gpt-pilot | tests/agents/test_base.py | .py | from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from core.agents.base import BaseAgent
from core.ui.base import UIBase
class AgentUnderTest(BaseAgent):
agent_type = "test-agent"
display_name = "Test Agent"
@pytest.mark.asyncio
async def test_send_message():
ui = MagicMock(spec=UIBa... | 93 | 2,749 |
gpt-pilot | tests/agents/test_external_docs.py | .py | from unittest.mock import patch
import pytest
from httpx import HTTPError
from core.agents.external_docs import DocQueries, ExternalDocumentation, SelectedDocsets
@pytest.mark.skip(reason="Temporary")
async def test_stores_documentation_snippets_for_task(agentcontext):
sm, _, ui, mock_llm = agentcontext
sm... | 51 | 1,558 |
scientific-agent-skills | scan_pr_skills.py | .py | #!/usr/bin/env python3
"""Scan a subset of skills (those changed in a pull request) and emit a PR comment.
Usage:
python scan_pr_skills.py [--output FILE] [--fail-on SEVERITY] SKILL_DIR ...
Each ``SKILL_DIR`` should be a directory containing a ``SKILL.md``. Directories
without a ``SKILL.md`` (e.g. deleted skills)... | 272 | 10,006 |
scientific-agent-skills | scan_skills.py | .py | #!/usr/bin/env python3
"""Scan all skills for security issues and produce the security scan report.
Writes a human-readable report plus a machine-readable companion. The two files
must always be generated together: the markdown links into the JSON for
per-skill scan dates, and the JSON is what the next run reads as it... | 616 | 23,346 |
scientific-agent-skills | tests/run_all.py | .py | #!/usr/bin/env python3
"""Run the skill test suites, one pytest process per skill.
Separate processes are required, not a preference: skills' `scripts/`
directories share top-level module names (see tests/conftest.py).
python tests/run_all.py # every skill under tests/
python tests/run_all... | 176 | 6,916 |
scientific-agent-skills | tests/conftest.py | .py | """Session guard for the repo-wide test tree.
Every skill's `scripts/` directory is self-contained and owns plain top-level
module names -- 32 skills ship a `scripts/_common.py`, and names like
`cluster.py` or `validate_manifest.py` are shared too. Tests import those
scripts by putting the skill's `scripts/` directory... | 106 | 3,994 |
scientific-agent-skills | tests/pydicom/test_scripts.py | .py | """Synthetic, local-only behavior tests for the pydicom helper CLIs."""
from __future__ import annotations
import json
import os
import subprocess
import sys
import tempfile
import unittest
from pathlib import Path
SKILL_ROOT = Path(__file__).resolve().parents[2] / "skills" / "pydicom"
SCRIPTS = SKILL_ROOT / "script... | 486 | 18,045 |
scientific-agent-skills | tests/pydicom/test_static.py | .py | """Static safety, provenance, and packaging tests for the pydicom skill."""
from __future__ import annotations
import ast
import re
import unittest
from pathlib import Path
SKILL_ROOT = Path(__file__).resolve().parents[2] / "skills" / "pydicom"
SCRIPTS = SKILL_ROOT / "scripts"
REFERENCES = SKILL_ROOT / "references"
... | 138 | 5,665 |
scientific-agent-skills | tests/opentrons-integration/test_scripts.py | .py | """Tests for the Opentrons protocol templates.
These scripts are not command-line tools: each is a Protocol API v2 file that the
Opentrons App loads, so the meaningful check is the one the App performs --
simulation. `opentrons.simulate.simulate()` runs each Flex template against the
virtual hardware in about a tenth ... | 600 | 25,415 |
scientific-agent-skills | tests/primekg/test_scripts.py | .py | """Tests for the PrimeKG query helpers.
PrimeKG itself is a ~4 million edge CSV nobody should download to run a test,
so these drive the same code against a small hand-built edge list with the
real column layout (`x_id, x_type, x_name, x_source, relation,
display_relation, y_*`). The queries treat the graph as undirec... | 189 | 8,172 |
scientific-agent-skills | tests/stable-baselines3/test_scripts.py | .py | """Tests for the Stable-Baselines3 environment, training, and evaluation templates.
`custom_env_template` is the piece with real logic, and all of it is checkable
against values fixed by the template's own docstring: action 0 moves up, the
reward is 1.0 on reaching the goal and -0.1 times the Euclidean distance
otherw... | 416 | 17,361 |
scientific-agent-skills | tests/lab-hardware-cad/test_scripts.py | .py | """Dependency-free tests for the lab-hardware-cad scripts.
Everything here runs without build123d: the standards database, the fit-check
arithmetic, argument parsing, and the CLI help paths. Geometry commands are
exercised only for their guarded failure when the kernel is absent.
"""
from __future__ import annotation... | 397 | 16,298 |
scientific-agent-skills | tests/uncertainty-and-units/test_scripts.py | .py | #!/usr/bin/env python3
"""Synthetic, network-free tests for the uncertainty-and-units helper CLIs."""
from __future__ import annotations
import ast
import json
import math
import stat
import sys
import tempfile
import unittest
from pathlib import Path
SKILL_ROOT = Path(__file__).resolve().parents[2] / "skills" / "u... | 1,078 | 45,014 |
scientific-agent-skills | tests/venue-templates/test_scripts.py | .py | """Tests for the venue-templates scripts.
The skill's whole claim is that its page limits and template notes are
*verified* against an official source rather than remembered, so the catalogue
tests below are the substantive ones: every preset carries a source URL and a
checked date, every template entry points at a fi... | 295 | 13,395 |
scientific-agent-skills | tests/treatment-plans/test_scripts.py | .py | """Synthetic, dependency-free tests for treatment-plan documentation CLIs."""
from __future__ import annotations
import ast
import copy
import json
import re
import sys
import tempfile
import unittest
from pathlib import Path
sys.dont_write_bytecode = True
SKILL_ROOT = Path(__file__).resolve().parents[2] / "skills"... | 527 | 22,113 |
scientific-agent-skills | tests/open-notebook/test_open_notebook_skill.py | .py | """
Test-Driven Development tests for the Open-Notebook skill.
These tests validate the structure, content completeness, and correctness
of the open-notebook skill implementation for the scientific-agent-skills repository.
Run with: python -m pytest tests/open-notebook -v
Or: python -m unittest tests/open-noteb... | 407 | 15,421 |
scientific-agent-skills | tests/ncats-arax/test_scripts.py | .py | from __future__ import annotations
import argparse
import copy
import importlib.util
import io
import json
import os
import re
import stat
import sys
import tempfile
import unittest
import urllib.error
import urllib.request
from datetime import datetime, timedelta, timezone
from email.message import Message
from pathl... | 1,532 | 70,634 |
scientific-agent-skills | tests/get-available-resources/test_scripts.py | .py | """Synthetic, network-free tests for resource detection and planning."""
from __future__ import annotations
import contextlib
import io
import json
import os
import stat
import sys
import tempfile
import unittest
from pathlib import Path
from types import SimpleNamespace
from unittest import mock
SKILL_ROOT = Path(_... | 522 | 20,273 |
scientific-agent-skills | tests/dnanexus-integration/test_scripts.py | .py | """Tests for the DNAnexus integration scripts.
`validate_dxapp` is an offline linter for `dxapp.json`, so the tests start from
one manifest that must be clean and mutate a single field per test. That shape
matters: a validator is only useful if a valid manifest stays silent, and a
suite built only from broken inputs n... | 583 | 24,497 |
scientific-agent-skills | tests/arbor/test_scripts.py | .py | """Tests for the Arbor hypothesis-tree state manager.
`tree.py` is the durable state of an Autonomous Optimization run, so the tests
drive it the way a coordinator does -- through the parser, one subcommand at a
time, against a real `.arbor/` directory in a temporary run dir -- and assert
on the JSON that lands on dis... | 462 | 20,426 |
scientific-agent-skills | tests/scientific-visualization/test_scripts.py | .py | """Synthetic, network-free tests for scientific-visualization helpers."""
from __future__ import annotations
import json
import importlib.util
import stat
import sys
import tempfile
import unittest
from pathlib import Path
SKILL_ROOT = Path(__file__).resolve().parents[2] / "skills" / "scientific-visualization"
SCRIP... | 353 | 13,606 |
scientific-agent-skills | tests/docx/test_scripts.py | .py | """Tests for the docx skill's OOXML editors.
The shared `office/` tree -- zip safety, relationship resolution, repacking --
is covered by the contract, since pptx and xlsx ship byte-identical copies.
What is specific to docx is the run merger and the comment writer, and both
edit `word/document.xml` in place, so the t... | 227 | 9,100 |
scientific-agent-skills | tests/pymc/test_scripts.py | .py | """Tests for the PyMC diagnostic and model-comparison helpers.
These scripts are the layer an agent trusts to say "this fit is usable" and
"this model wins", so the tests attack both halves of that. The diagnostic
branches are driven from hand-built posteriors where the right answer is known
by construction -- 2 chain... | 451 | 20,451 |
scientific-agent-skills | tests/fluidsim/test_scripts.py | .py | """Dependency-free synthetic tests for the FluidSim skill CLIs."""
from __future__ import annotations
import ast
import json
import os
import subprocess
import sys
import tempfile
import unittest
from copy import deepcopy
from pathlib import Path
SKILL_ROOT = Path(__file__).resolve().parents[2] / "skills" / "fluids... | 296 | 11,112 |
scientific-agent-skills | tests/fluidsim/test_static.py | .py | """Static safety, packaging, and documentation tests for the FluidSim skill."""
from __future__ import annotations
import ast
import re
import unittest
from pathlib import Path
SKILL_ROOT = Path(__file__).resolve().parents[2] / "skills" / "fluidsim"
SCRIPTS = SKILL_ROOT / "scripts"
REFERENCES = SKILL_ROOT / "refere... | 113 | 4,246 |
scientific-agent-skills | tests/diffdock/test_scripts.py | .py | """Tests for the DiffDock helper scripts.
Docking itself needs a GPU, the upstream repository, and downloaded
checkpoints, so nothing here runs inference. What these scripts do around a run
is what the tests cover, and each group guards a specific way the surrounding
work goes wrong:
* `analyze_results` turns a direc... | 658 | 29,623 |
scientific-agent-skills | tests/matlab/test_scripts.py | .py | """Synthetic local-only tests for the MATLAB helper CLIs."""
from __future__ import annotations
import json
import os
import subprocess
import sys
import tempfile
import unittest
from pathlib import Path
SKILL_ROOT = Path(__file__).resolve().parents[2] / "skills" / "matlab"
SCRIPTS = SKILL_ROOT / "scripts"
CLI_NAMES... | 381 | 13,619 |
scientific-agent-skills | tests/matlab/test_static.py | .py | """Static packaging, safety, and documentation tests for the MATLAB skill."""
from __future__ import annotations
import ast
import json
import re
import unittest
from pathlib import Path
from urllib.parse import urlsplit
SKILL_ROOT = Path(__file__).resolve().parents[2] / "skills" / "matlab"
SCRIPTS = SKILL_ROOT / "s... | 233 | 9,054 |
scientific-agent-skills | tests/ontology-term-resolution/test_scripts.py | .py | """Unit tests for the ontology-term-resolution skill scripts.
The offline tests stub every network call, so the suite runs without touching
EBI. A handful of live smoke tests are gated behind OLS_LIVE_TESTS=1; they
document the API behaviour the scripts were built against.
uv run --with pytest python -m pytest te... | 489 | 20,446 |
scientific-agent-skills | tests/generate-image/test_scripts.py | .py | """Dependency-free, network-free tests for the generate-image helper CLI."""
from __future__ import annotations
import argparse
import base64
import importlib.util
import os
import subprocess
import sys
import tempfile
import unittest
from pathlib import Path
SKILL_ROOT = Path(__file__).resolve().parents[2] / "skill... | 554 | 23,226 |
scientific-agent-skills | tests/hypogenic/test_scripts.py | .py | """Synthetic, deterministic, network-free tests for the HypoGeniC skill."""
from __future__ import annotations
import ast
import hashlib
import json
import os
import re
import subprocess
import sys
import tempfile
import unittest
from pathlib import Path
from typing import Any
SKILL_ROOT = Path(__file__).resolve().... | 570 | 20,032 |
scientific-agent-skills | tests/statistical-power/test_scripts.py | .py | """Tests for the statistical-power calculators.
Power analysis is a place where a plausible-looking wrong answer costs real
money and real subjects, so these tests check numbers against values that can
be verified independently rather than against whatever the code happens to
return. Cohen's canonical results are the ... | 332 | 14,408 |
scientific-agent-skills | tests/etetoolkit/test_scripts.py | .py | """Tests for the ETE 4 tree helpers.
Three things in these scripts can be wrong in ways a user would not notice.
The diagnostics in `tree_stats` are numbers people quote in papers, so they are
checked against a Newick string whose leaf count, branch lengths, farthest-leaf
distance, and support values are all known by ... | 913 | 42,073 |
scientific-agent-skills | tests/pymatgen/test_scripts.py | .py | """Dependency-free help checks and pinned-runtime synthetic CLI tests."""
from __future__ import annotations
import contextlib
import io
import json
import os
import sys
import tempfile
import unittest
from pathlib import Path
from unittest import mock
SKILL_ROOT = Path(__file__).resolve().parents[2] / "skills" / "... | 415 | 14,577 |
scientific-agent-skills | tests/pymatgen/test_static.py | .py | """Static safety, packaging, and documentation checks for the pymatgen skill."""
from __future__ import annotations
import ast
import re
import unittest
from pathlib import Path
SKILL_ROOT = Path(__file__).resolve().parents[2] / "skills" / "pymatgen"
SCRIPTS = SKILL_ROOT / "scripts"
REFERENCES = SKILL_ROOT / "refer... | 186 | 7,140 |
scientific-agent-skills | tests/pptx/test_scripts.py | .py | """Tests for the pptx skill's package editors.
The shared `office/` tree is covered by the contract. What is specific here is
slide bookkeeping: `add_slide` has to pick a free slide number and a legal
slide id, and `clean` has to delete orphaned parts without deleting anything
the presentation still references.
`clea... | 237 | 9,781 |
scientific-agent-skills | tests/scientific-slides/test_scripts.py | .py | """Tests for the scientific-slides tooling.
`generate_schematic.py` and `generate_schematic_ai.py` are byte-identical to the
copies in four other skills, so their behaviour comes from the shared contract
(`skill_contract.schematic`) rather than being re-tested here. What is specific
to this skill is the slide pipeline... | 1,020 | 46,080 |
scientific-agent-skills | tests/pacsomatic/test_run_pacsomatic.py | .py | import importlib.util
import tempfile
import unittest
from pathlib import Path
from types import SimpleNamespace
import skill_contract
SKILL_ROOT = Path(__file__).resolve().parents[2] / "skills" / "pacsomatic"
SCRIPT_PATH = SKILL_ROOT / "scripts" / "run_pacsomatic.py"
def _load_module():
spec = importlib.util.s... | 85 | 3,152 |
scientific-agent-skills | tests/exploratory-data-analysis/test_scripts.py | .py | #!/usr/bin/env python3
"""Synthetic, network-free behavior tests for the bounded EDA tools."""
from __future__ import annotations
import json
import os
import stat
import sys
import tempfile
import unittest
import zipfile
from pathlib import Path
SKILL_ROOT = Path(__file__).resolve().parents[2] / "skills" / "explor... | 390 | 16,688 |
scientific-agent-skills | tests/exploratory-data-analysis/test_static.py | .py | #!/usr/bin/env python3
"""Static and dependency-free CLI checks for exploratory-data-analysis."""
from __future__ import annotations
import ast
import os
import subprocess
import sys
import unittest
from pathlib import Path
SKILL_ROOT = Path(__file__).resolve().parents[2] / "skills" / "exploratory-data-analysis"
SC... | 119 | 4,305 |
scientific-agent-skills | tests/pytdc/test_scripts.py | .py | #!/usr/bin/env python3
"""Synthetic, network-free tests for the bundled PyTDC command-line helpers."""
from __future__ import annotations
import json
import os
import sys
import tempfile
import unittest
from pathlib import Path
from types import SimpleNamespace
SCRIPTS = Path(__file__).resolve().parents[2] / "skill... | 230 | 7,966 |
scientific-agent-skills | tests/omero-integration/test_scripts.py | .py | """Synthetic tests for the OMERO helper scripts; no server is contacted."""
from __future__ import annotations
import argparse
import json
import os
import stat
import sys
import tempfile
import unittest
from pathlib import Path
SKILL_ROOT = Path(__file__).resolve().parents[2] / "skills" / "omero-integration"
SCRIP... | 349 | 10,562 |
scientific-agent-skills | tests/analytical-method-validation/test_scripts.py | .py | """Unit tests for the analytical-method-validation skill scripts.
Everything runs offline; the scripts make no network calls. The statistical
implementations are checked against published quantiles and hand-checkable
cases, because the whole value of the skill rests on them being right.
uv run --with pytest pytho... | 957 | 44,501 |
scientific-agent-skills | tests/pathml/test_scripts.py | .py | #!/usr/bin/env python3
"""Synthetic, network-free tests for the PathML skill CLIs."""
from __future__ import annotations
import ast
import json
import os
import stat
import subprocess
import sys
import tempfile
import unittest
from pathlib import Path
SKILL_ROOT = Path(__file__).resolve().parents[2] / "skills" / "p... | 442 | 16,358 |
scientific-agent-skills | tests/gget/test_scripts.py | .py | """Tests for the gget workflow scripts.
Every gget module in these scripts is a network call, so all three suites patch
the gget function with `autospec=True` and assert on the call that *would* have
gone out. `autospec` is load-bearing rather than decoration: it binds each
recorded call against the installed gget sig... | 556 | 23,651 |
scientific-agent-skills | tests/scikit-learn/test_scripts.py | .py | """Tests for the scikit-learn pipeline and clustering templates.
The value of `create_preprocessing_pipeline` is that it fits its imputer and
scaler *inside* a Pipeline, so cross-validation never lets test-fold statistics
reach the training fold. That is the leak these templates exist to prevent, and
it is what the te... | 263 | 10,527 |
scientific-agent-skills | tests/medchem/test_scripts.py | .py | """Tests for the medchem batch-filtering script.
`filter_molecules.py` has two halves worth guarding. The first is input
handling: `load_molecules` reads four file formats, and when it drops an
unparseable SMILES it must drop the matching DataFrame row too -- otherwise
every downstream filter column is offset against ... | 395 | 18,941 |
scientific-agent-skills | tests/infographics/test_scripts.py | .py | """Tests for the infographics generator CLI.
Generation goes through OpenRouter, so nothing here calls it. What is testable
offline is the part that decides what the subprocess sees and what the user may
ask for: the environment allowlist (the same design as the schematic scripts --
forward a named set, never the whol... | 174 | 7,115 |
scientific-agent-skills | tests/pymoo/test_scripts.py | .py | """Tests for the pymoo optimisation examples.
The examples are worth testing at two levels. The problem definitions are pure
arithmetic with hand-computable answers -- `MyBiObjectiveProblem` at (0, 0) must
be (0, 2), and `ConstrainedProblem` must call (1.0, 0.0) feasible and (0.1, 0.0)
infeasible -- so a transcription... | 310 | 14,190 |
scientific-agent-skills | tests/market-research-reports/test_scripts.py | .py | """Synthetic, dependency-free tests for the bundled local CLIs."""
from __future__ import annotations
import copy
import json
import sys
import tempfile
import unittest
from pathlib import Path
SKILL_ROOT = Path(__file__).resolve().parents[2] / "skills" / "market-research-reports"
SCRIPTS = SKILL_ROOT / "scripts"
AS... | 217 | 8,723 |
scientific-agent-skills | tests/_contract/structure.py | .py | """The structural contract every skill in this repository must satisfy.
Nothing here imports skill code. Scripts are read and parsed with `ast`, never
executed, so the whole contract is safe to run against every skill inside a
single interpreter -- which is what `tests/_meta` does. Per-skill suites that
*do* import th... | 433 | 16,648 |
scientific-agent-skills | tests/_contract/__init__.py | .py | """Shared test contract for every skill in this repository.
Suites do not import this package by name from `sys.path` -- putting `tests/`
on `sys.path` would turn `tests/simpy/`, `tests/qutip/`, `tests/neurokit2/` and
friends into importable namespace packages that shadow the real libraries (see
the comment on `addopt... | 39 | 1,365 |
scientific-agent-skills | tests/_contract/office.py | .py | """Shared tests for the OOXML `office/` tree bundled by docx, pptx, and xlsx.
Those three skills each ship a byte-identical copy of `scripts/office/` --
`helpers/`, `validators/`, `validate.py`, `soffice.py`, and the vendored
ISO/ECMA schemas. Rather than write the same tests three times, each suite
instantiates `offi... | 295 | 12,671 |
scientific-agent-skills | tests/_contract/cli.py | .py | """`--help` contract for a skill's bundled command-line scripts.
Unlike `structure`, this half actually runs the scripts, so what it proves
depends on the environment. In the bare project environment most scientific
packages are absent and the affected scripts skip; under
`python tests/run_all.py --isolated`, where ea... | 212 | 8,558 |
scientific-agent-skills | tests/_contract/schematic.py | .py | """Shared tests for the AI schematic generator bundled by several skills.
`scientific-schematics`, `latex-posters`, `literature-review`, and
`scientific-slides` each ship a byte-identical
`scripts/generate_schematic.py` (a thin CLI) and `scripts/generate_schematic_ai.py`
(the generator). Rather than write the same tes... | 285 | 12,705 |
scientific-agent-skills | tests/markitdown/test_scripts.py | .py | """Tests for the MarkItDown batch converters.
Conversion itself is MarkItDown's job. What these scripts own is everything
around it, and each piece has a failure mode worth guarding:
* `discover_files` decides what gets converted -- and must not silently pick up
audio and video, because with `markitdown[all]` those... | 280 | 11,470 |
scientific-agent-skills | tests/scvelo/test_scripts.py | .py | """Tests for the scVelo RNA velocity workflow.
`run_velocity_analysis` is one long pipeline, so the tests split it in two by
what can go wrong:
* The preprocessing and estimation steps run for real, on a synthetic AnnData of
60 cells x 40 genes built here rather than downloaded. That is what caught the
bug this s... | 405 | 16,445 |
scientific-agent-skills | tests/peer-review/test_scripts.py | .py | """Synthetic, dependency-free tests for the peer-review local CLIs."""
from __future__ import annotations
import ast
import csv
import json
import stat
import sys
import tempfile
import unittest
from pathlib import Path
sys.dont_write_bytecode = True
SKILL_ROOT = Path(__file__).resolve().parents[2] / "skills" / "pe... | 397 | 16,992 |
scientific-agent-skills | tests/onekgpd/test_scripts.py | .py | """Tests for the OneKGPd query wrappers over the 1000 Genomes Project.
`onekgpd_api` talks to a public gRPC endpoint, so every test here replaces
`DnaerysClient` with a recorder and asserts on the request that *would* have
been sent: the region, the zygosity pair, the annotation filter, and the
provenance echo written... | 1,312 | 54,894 |
scientific-agent-skills | tests/autoskill/test_backends.py | .py | import httpx
import pytest
from backends import ClaudeBackend, LocalBackend, make_backend
def _mock_client(handler, base_url=""):
return httpx.Client(transport=httpx.MockTransport(handler), base_url=base_url)
def test_claude_backend_posts_to_v1_messages_with_auth_headers():
calls = []
def handler(requ... | 122 | 4,252 |
scientific-agent-skills | tests/autoskill/smoke_lmstudio.py | .py | """Real smoke test against a live LM Studio server.
Not part of the pytest suite — requires LM Studio running on localhost:1234
with Gemma-4-31B-it loaded. Run manually:
pipenv run python tests/autoskill/smoke_lmstudio.py
"""
import json
import sys
from pathlib import Path
REPO_ROOT = Path(__file__).resolve().p... | 62 | 2,066 |
scientific-agent-skills | tests/autoskill/test_e2e.py | .py | """End-to-end tests for the autoskill pipeline.
Exercises the full chain — fetch → redact → cluster → match → synthesize → write
— with real internal modules. External dependencies (screenpipe, LLM, embeddings)
are replaced with deterministic fakes so the suite runs offline in under a second.
"""
import json
import s... | 328 | 12,172 |
scientific-agent-skills | tests/autoskill/test_redact.py | .py | from redact import redact
# Test fixtures are synthetic strings *constructed* at runtime from parts
# so they exercise the redaction regex without appearing as literal secret
# patterns in the source (which would trip SECRET_* rules in skill-scanner
# on every scan). Each value is functionally a secret-shape placehold... | 131 | 4,576 |
scientific-agent-skills | tests/autoskill/test_run.py | .py | import json
from pathlib import Path
import httpx
import pytest
from run import run, ScreenpipeUnreachable
SKILL_TEMPLATE = "---\nname: {name}\ndescription: {description}\n---\n# {name}\n"
def _write_skill(root: Path, name: str, description: str) -> None:
d = root / name
d.mkdir(parents=True, exist_ok=Tru... | 230 | 8,111 |
scientific-agent-skills | tests/autoskill/test_synthesize.py | .py | import json
import pytest
from synthesize import synthesize, SynthesisError
class StubBackend:
def __init__(self, response: str):
self.response = response
self.last_prompt = None
def __call__(self, prompt: str) -> str:
self.last_prompt = prompt
return self.response
def _cl... | 97 | 3,143 |
scientific-agent-skills | tests/autoskill/test_fetch_window.py | .py | import httpx
import pytest
from fetch_window import fetch_window
def _make_client(handler):
transport = httpx.MockTransport(handler)
return httpx.Client(transport=transport, base_url="http://localhost:3030")
def _ocr_event(ts: str, app: str, title: str, text: str) -> dict:
return {
"type": "OCR... | 112 | 3,774 |
scientific-agent-skills | tests/autoskill/test_doctor.py | .py | from pathlib import Path
from doctor import check, main as doctor_main
def _config(tmp_path: Path) -> dict:
return {
"backend": "local",
"local": {"endpoint": "http://localhost:1234/v1", "model": "m"},
"screenpipe": {"url": "http://localhost:3030"},
}
def _ok_probe(*_args, **_kwargs... | 109 | 3,041 |
scientific-agent-skills | tests/autoskill/test_cluster.py | .py | from cluster import segment_sessions, cluster_sessions
def _evt(ts: int, app: str, title: str = "", text: str = "") -> dict:
return {"ts": ts, "app": app, "window_title": title, "text": text}
def test_contiguous_events_form_one_session():
events = [_evt(i * 30, "VSCode") for i in range(20)] # 10 minutes
... | 68 | 2,790 |
scientific-agent-skills | tests/autoskill/test_cli.py | .py | from pathlib import Path
import pytest
import autoskill
import skill_contract
def test_dispatches_to_run_subcommand(monkeypatch):
calls = {}
def fake_run_main(argv):
calls["run"] = argv
return 0
monkeypatch.setattr("run.main", fake_run_main)
rc = autoskill.main(["run", "--start", ... | 71 | 1,944 |
scientific-agent-skills | tests/autoskill/test_match_skills.py | .py | from pathlib import Path
from match_skills import load_skill_descriptions, top_k_matches
SKILL_TEMPLATE = """---
name: {name}
description: {description}
---
# {name}
"""
def _write_skill(root: Path, name: str, description: str) -> None:
d = root / name
d.mkdir(parents=True, exist_ok=True)
(d / "SKILL.... | 76 | 2,583 |
scientific-agent-skills | tests/autoskill/test_promote.py | .py | from pathlib import Path
import pytest
from promote import promote, PromoteError, main as promote_main
def _stage_proposed_skill(proposed_root: Path, kind: str, name: str,
body: str = "---\nname: s\ndescription: d\n---\n# x") -> Path:
skill_dir = proposed_root / kind / name
skill_d... | 109 | 3,552 |
scientific-agent-skills | tests/autoskill/conftest.py | .py | import sys
from pathlib import Path
SKILL_ROOT = Path(__file__).resolve().parents[2] / "skills" / "autoskill"
sys.path.insert(0, str(SKILL_ROOT / "scripts"))
| 6 | 159 |
scientific-agent-skills | tests/geniml/test_scripts.py | .py | """Dependency-free synthetic tests for Geniml skill helper CLIs."""
from __future__ import annotations
import ast
import json
import subprocess
import sys
import tempfile
import unittest
from pathlib import Path
SKILL_ROOT = Path(__file__).resolve().parents[2] / "skills" / "geniml"
SCRIPTS = SKILL_ROOT / "scripts"
... | 367 | 13,690 |
scientific-agent-skills | tests/arboreto/test_scripts.py | .py | """Tests for the Arboreto GRN inference wrapper.
GRNBoost2 on real data is a distributed, minutes-long job, so the tests stub
`grnboost2` and assert on the contract between the wrapper and the algorithm:
the expression matrix is read genes-as-columns, `tf_names` defaults to the
sentinel `'all'` rather than an empty li... | 128 | 4,998 |
scientific-agent-skills | tests/labarchive-integration/test_scripts.py | .py | """Tests for the LabArchives integration helpers.
Three security boundaries live in these scripts, and all three are testable
without touching LabArchives:
* the HMAC-SHA-512 request signature, which the vendor documents with a public
test vector -- so the suite is a known-answer test, not a self-consistency
chec... | 401 | 18,227 |
scientific-agent-skills | tests/hugging-science/test_scripts.py | .py | """Tests for the Hugging Science catalogue fetcher.
The whole script is a markdown parser wrapped in a network call, so the tests
feed `parse_markdown` fixture documents directly and never fetch anything. The
parser is a small state machine over headings and bullets, and its edge cases
-- a section suffix like `## Dat... | 268 | 10,892 |
scientific-agent-skills | tests/pufferlib/test_scripts.py | .py | #!/usr/bin/env python3
"""Dependency-free synthetic tests for all bundled PufferLib CLIs."""
from __future__ import annotations
import hashlib
import json
import os
import subprocess
import sys
import tempfile
import unittest
from pathlib import Path
SKILL_DIR = Path(__file__).resolve().parents[2] / "skills" / "puff... | 245 | 8,805 |
scientific-agent-skills | tests/genomic-coordinates/test_scripts.py | .py | """Unit tests for the genomic-coordinates skill scripts.
Everything runs offline against the fixtures in ``fixtures/``. The reference
FASTA is ten bases long and deliberately contains a ``CACACAC`` repeat, which is
what makes the left-alignment cases interesting.
uv run --with pytest python -m pytest tests/genomi... | 662 | 27,312 |
scientific-agent-skills | tests/neuropixels-analysis/test_scripts.py | .py | """Tests for the Neuropixels SpikeInterface scripts.
Almost everything here is a wrapper around SpikeInterface calls that need a real
recording, but the part that decides which units make it into a published result
is pure: the curation thresholds and the classification they drive. Those are
checked against the criter... | 317 | 15,401 |
scientific-agent-skills | tests/imaging-data-commons/test_check_version.py | .py | """
Contract for the one script imaging-data-commons bundles, `scripts/check_version.py`.
The skill's startup step. It reports whether `idc-index` is installed and at least the
version the skill was tested against, prints the install command for the interpreter
that ran it, and exits non-zero so the agent stops rather... | 200 | 9,121 |
scientific-agent-skills | tests/scientific-writing/test_scripts.py | .py | """Behavior tests for dependency-free scientific-writing scripts."""
from __future__ import annotations
import argparse
import json
import sys
import tempfile
import unittest
from pathlib import Path
ROOT = Path(__file__).resolve().parents[2] / "skills" / "scientific-writing"
SCRIPTS = ROOT / "scripts"
sys.path.inse... | 226 | 8,741 |
scientific-agent-skills | tests/scientific-writing/synthetic_manuscript.py | .py | """Synthetic, non-submission fixtures for local scientific-writing tests."""
from __future__ import annotations
import hashlib
def valid_source_manifest() -> dict:
return {
"schema_version": "1.0",
"sources": [
{
"evidence_id": "E001",
"source_type": "... | 188 | 6,122 |
scientific-agent-skills | tests/scientific-writing/test_static.py | .py | """Static safety and packaging tests for scientific-writing."""
from __future__ import annotations
import ast
import csv
import io
import json
import re
import unittest
from pathlib import Path
ROOT = Path(__file__).resolve().parents[2] / "skills" / "scientific-writing"
REPO_ROOT = ROOT.parents[1]
SCRIPT_DIR = ROOT ... | 176 | 6,791 |
scientific-agent-skills | tests/exa-search/test_exa_search.py | .py | """Unit tests for the exa-search skill scripts.
These tests mock the Exa SDK so they never hit the live API. Run from the
skill root:
python -m unittest discover -s tests -v
Tests cover: CLI argument plumbing, the content-options builder (text /
highlights), CSV splitting for domain lists, the content fallback
c... | 231 | 8,803 |
scientific-agent-skills | tests/research-lookup/test_research_lookup.py | .py | """Regression tests for the Parallel-first research lookup skill."""
from __future__ import annotations
import sys
import tempfile
import unittest
from pathlib import Path
from unittest.mock import patch
REPO_ROOT = Path(__file__).resolve().parents[2]
SCRIPT_DIR = REPO_ROOT / "skills" / "research-lookup" / "scripts... | 388 | 14,976 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.