MCPcopy
hub / github.com/apache/devlake / TestMissingProperty

Function TestMissingProperty

backend/core/utils/json_test.go:37–46  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

35}
36
37func TestMissingProperty(t *testing.T) {
38 object := map[string]interface{}{
39 "id": 1,
40 }
41
42 _, err := GetProperty[int](object, "name")
43
44 assert.Error(t, err)
45 assert.Contains(t, err.Error(), "Missing property \"name\"")
46}
47
48func TestInvalidPropertyType(t *testing.T) {
49 object := map[string]interface{}{

Callers

nothing calls this directly

Calls 1

ErrorMethod · 0.65

Tested by

no test coverage detected