MCPcopy Create free account
hub / github.com/evilsocket/sum / TestServiceReadOracle

Function TestServiceReadOracle

service/oracles_test.go:145–161  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

143}
144
145func TestServiceReadOracle(t *testing.T) {
146 setup(t, true, true)
147 defer teardown(t)
148
149 byID.Id = 1
150 if svc, err := New(testFolder, "", ""); err != nil {
151 t.Fatal(err)
152 } else if resp, err := svc.ReadOracle(context.TODO(), &byID); err != nil {
153 t.Fatal(err)
154 } else if !resp.Success {
155 t.Fatalf("expected success response: %v", resp)
156 } else if resp.Oracle == nil {
157 t.Fatal("expected oracles list")
158 } else if testOracle.Id = byID.Id; !sameOracle(*resp.Oracle, testOracle) {
159 t.Fatalf("oracle does not match: %v", resp.Oracle)
160 }
161}
162
163func TestServiceReadOracleWithInvalidId(t *testing.T) {
164 setup(t, true, true)

Callers

nothing calls this directly

Calls 5

setupFunction · 0.85
teardownFunction · 0.85
NewFunction · 0.85
sameOracleFunction · 0.70
ReadOracleMethod · 0.65

Tested by

no test coverage detected