add tests for agent/client.go and hub/ws/ws.go

This commit is contained in:
henrygd
2025-07-23 15:54:02 -04:00
parent 46fdc94cb8
commit 485f7d16ff
3 changed files with 615 additions and 0 deletions

View File

@@ -114,6 +114,9 @@ func (ws *WsConn) Ping() error {
// sendMessage encodes data to CBOR and sends it as a binary message to the agent.
func (ws *WsConn) sendMessage(data common.HubRequest[any]) error {
if ws.conn == nil {
return gws.ErrConnClosed
}
bytes, err := cbor.Marshal(data)
if err != nil {
return err