Files
archie/.okf/codebase/internal/forge/testclient_test.md
T
sam 7c34bdae5a okf: scaffold knowledge bundle and MCP server config
Adds a harvested .okf/ knowledge bundle (codebase concepts + starter
architecture/services/rules scaffolding) and .mcp.json pointing at the
shared okf MCP service (http://localhost:8765/archie-core/), which
serves multiple projects' bundles from a single process.
2026-07-22 04:36:50 +10:00

1020 B

description, resource, tags, timestamp, title, type
description resource tags timestamp title type
Source module internal/forge/testclient_test.go (31 lines). internal/forge/testclient_test.go
go
source
2026-07-21T18:36:22Z testclient_test.go Module

Module testclient_test.go

Path: internal/forge/testclient_test.go
Lines: 31

Snippet Preview

package forge

import (
	"io"
	"log/slog"
	"net/http"
	"net/http/httptest"
	"net/url"
	"testing"

	"github.com/google/go-github/v78/github"
)

// newTestClient wires a GitHubClient at a local httptest server so its
// methods can be exercised without hitting the real GitHub API.
func newTestClient(t *testing.T) (*GitHubClient, *http.ServeMux) {
	t.Helper()
	mux := http.NewServeMux()
	srv := httptest.NewServer(mux)
	t.Cleanup(srv.Close)

	gh := github.NewClient(nil)
	base, err := url.Parse(srv.URL + "/")
	if err != nil {
		t.Fatal(err)
	}
	gh.BaseURL = base
	gh.UploadURL = base

	return &GitHubClient{gh: gh, log: slog.New(slog.NewTextHandler(io.Discard, nil))}, mux