direct-tests
Write and run fast direct mode tests for GenLayer intelligent contracts.
npx skills add internet-court/internet-court-skill --skill direct-tests --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Direct Mode Tests Write fast, in-memory tests for intelligent contracts. No server, no Docker — tests run in ~30-50ms. ## Running Tests ```bash pytest tests/direct/ -v pytest tests/direct/test_specific.py -v pytest tests/direct/test_specific.py::test_one_case -v ``` ## Fixtures Available from `genlayer-test` pytest plugin: ```python def test_example(direct_vm, direct_deploy, direct_alice, direct_bob): # direct_vm — VMContext with cheatcodes # direct_deploy — deploy a contract file # direct_alice — test address # direct_bob — test address pass ``` All fixtures: `direct_vm`, `direct_deploy`, `direct_alice`, `direct_bob`, `direct_charlie`, `direct_owner`, `direct_accounts` ## Basic Test Pattern ```python def test_set_and_get(direct_vm, direct_deploy, direct_alice): contract = direct_deploy("contracts/my_contract.py") direct_vm.sender = direct_alice contract.set_data("hello") result = contract.get_data(direct_alice) assert result == "hello" ``` ## Mocking Web Requests For contracts that call `gl.nondet.web.get()`: ```python import json def test_with_web_mock(direct_vm, direct_deploy, direct_alice): contract = direct_deploy("contracts/my_contract.py") direct_vm.sender = direct_alice #
- Running Tests
- Fixtures
- Basic Test Pattern
- Mocking Web Requests
- Full mock format (when you need headers/method control)
- Mocking LLM Responses
- Clearing Mocks
- VMContext Cheatcodes
- Test Organization
- What to Test in Direct Mode
- Common Patterns
- Testing access control
- Testing state transitions
- Reusable mock helpers (conftest.py)
pytest tests/direct/ -v pytest tests/direct/test_specific.py -v pytest tests/direct/test_specific.py::test_one_case -v
What does the direct-tests skill do?
Write and run fast direct mode tests for GenLayer intelligent contracts.
How do I install it?
Run `npx skills add internet-court/internet-court-skill --skill direct-tests --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From internet-court/internet-court-skill, a repository with 1,536 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.