MCPcopy Create free account
hub / github.com/digitalocean/go-libvirt / TestExtractHeader

Function TestExtractHeader

socket/socket_test.go:34–60  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

32}
33
34func TestExtractHeader(t *testing.T) {
35 r := bytes.NewBuffer(testHeader)
36 h, err := extractHeader(r)
37 if err != nil {
38 t.Error(err)
39 }
40
41 if h.Program != constants.Program {
42 t.Errorf("expected Program %q, got %q", constants.Program, h.Program)
43 }
44
45 if h.Version != constants.ProtocolVersion {
46 t.Errorf("expected version %q, got %q", constants.ProtocolVersion, h.Version)
47 }
48
49 if h.Procedure != constants.ProcConnectOpen {
50 t.Errorf("expected procedure %q, got %q", constants.ProcConnectOpen, h.Procedure)
51 }
52
53 if h.Type != Call {
54 t.Errorf("expected type %q, got %q", Call, h.Type)
55 }
56
57 if h.Status != StatusOK {
58 t.Errorf("expected status %q, got %q", StatusOK, h.Status)
59 }
60}

Callers

nothing calls this directly

Calls 2

extractHeaderFunction · 0.85
ErrorMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…