From f50aad709075c1f06bfc7285c3185382dfcdcf20 Mon Sep 17 00:00:00 2001 From: Jeff Halter <868228+jhalter@users.noreply.github.com> Date: Fri, 10 Jul 2026 09:45:04 -0700 Subject: Move testify mocks out of production files into hotline/hltest The manager mocks lived in production source so that internal/mobius tests could import them (test files are not importable across packages), which pulled testify into the production dependency graph of hotline importers, counted the mocks against coverage, and put them in the library's godoc. They now live in hotline/hltest, an httptest-style test-support package. The hotline package's own in-package tests cannot import hltest (import cycle), so the mocks they use are duplicated in mocks_test.go; conformance assertions in both files catch signature drift. MockAccountManager was only ever used inside internal/mobius and moves to a _test.go file there. --- hotline/client_manager.go | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'hotline/client_manager.go') diff --git a/hotline/client_manager.go b/hotline/client_manager.go index 22d096d..60f0388 100644 --- a/hotline/client_manager.go +++ b/hotline/client_manager.go @@ -6,8 +6,6 @@ import ( "slices" "sync" "sync/atomic" - - "github.com/stretchr/testify/mock" ) type ClientID [2]byte @@ -19,29 +17,6 @@ type ClientManager interface { Delete(id ClientID) } -type MockClientMgr struct { - mock.Mock -} - -func (m *MockClientMgr) List() []*ClientConn { - args := m.Called() - - return args.Get(0).([]*ClientConn) -} - -func (m *MockClientMgr) Get(id ClientID) *ClientConn { - args := m.Called(id) - - return args.Get(0).(*ClientConn) -} - -func (m *MockClientMgr) Add(cc *ClientConn) { - m.Called(cc) -} -func (m *MockClientMgr) Delete(id ClientID) { - m.Called(id) -} - type MemClientMgr struct { clients map[ClientID]*ClientConn -- cgit