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

Function TestServiceUpdateOracleWithInvalidId

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

Source from the content-addressed store, hash-verified

110}
111
112func TestServiceUpdateOracleWithInvalidId(t *testing.T) {
113 setupFolders(t)
114 defer teardown(t)
115
116 updatedOracle.Id = 1
117 if svc, err := New(testFolder, "", ""); err != nil {
118 t.Fatal(err)
119 } else if resp, err := svc.UpdateOracle(context.TODO(), &updatedOracle); err != nil {
120 t.Fatal(err)
121 } else if resp.Success {
122 t.Fatalf("expected error response: %v", resp)
123 } else if resp.Msg != storage.ErrRecordNotFound.Error() {
124 t.Fatalf("unexpected response message: %s", resp.Msg)
125 }
126}
127
128func TestServiceUpdateWithBrokenOracle(t *testing.T) {
129 setup(t, true, true)

Callers

nothing calls this directly

Calls 5

setupFoldersFunction · 0.85
teardownFunction · 0.85
NewFunction · 0.85
ErrorMethod · 0.80
UpdateOracleMethod · 0.65

Tested by

no test coverage detected