MCPcopy Create free account
hub / github.com/DeAI-Artist/Linkis / TestRPCConfigValidateBasic

Function TestRPCConfigValidateBasic

config/config_test.go:67–86  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

65}
66
67func TestRPCConfigValidateBasic(t *testing.T) {
68 cfg := TestRPCConfig()
69 assert.NoError(t, cfg.ValidateBasic())
70
71 fieldsToTest := []string{
72 "GRPCMaxOpenConnections",
73 "MaxOpenConnections",
74 "MaxSubscriptionClients",
75 "MaxSubscriptionsPerClient",
76 "TimeoutBroadcastTxCommit",
77 "MaxBodyBytes",
78 "MaxHeaderBytes",
79 }
80
81 for _, fieldName := range fieldsToTest {
82 reflect.ValueOf(cfg).Elem().FieldByName(fieldName).SetInt(-1)
83 assert.Error(t, cfg.ValidateBasic())
84 reflect.ValueOf(cfg).Elem().FieldByName(fieldName).SetInt(0)
85 }
86}
87
88func TestP2PConfigValidateBasic(t *testing.T) {
89 cfg := TestP2PConfig()

Callers

nothing calls this directly

Calls 3

TestRPCConfigFunction · 0.85
ValidateBasicMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected