MCPcopy Create free account
hub / github.com/erpc/erpc / TestHttpServer_SingleUpstream

Function TestHttpServer_SingleUpstream

erpc/http_server_test.go:1250–2607  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1248 })
1249}
1250func TestHttpServer_SingleUpstream(t *testing.T) {
1251 util.ResetGock()
1252 defer util.ResetGock()
1253
1254 type testCase struct {
1255 name string
1256 configure func(cfg *common.Config)
1257 }
1258
1259 // Define your test cases
1260 testCases := []testCase{
1261 // {
1262 // name: "UpstreamSupportsBatch",
1263 // configure: func(cfg *common.Config) {
1264 // cfg.Projects[0].Upstreams[0].JsonRpc.SupportsBatch = &common.TRUE
1265 // cfg.Projects[0].Upstreams[0].JsonRpc.BatchMaxSize = 1
1266 // cfg.Projects[0].Upstreams[0].JsonRpc.BatchMaxWait = common.Duration(10 * time.Millisecond)
1267 // },
1268 // },
1269 {
1270 name: "UpstreamDoesNotSupportBatch",
1271 configure: func(cfg *common.Config) {
1272 cfg.Projects[0].Upstreams[0].JsonRpc.SupportsBatch = &common.FALSE
1273 },
1274 },
1275 // {
1276 // name: "CachingEnabled",
1277 // configure: func(cfg *common.Config) {
1278 // cfg.Database = &common.DatabaseConfig{
1279 // EvmJsonRpcCache: &common.CacheConfig{
1280 // Connectors: []*common.ConnectorConfig{
1281 // {
1282 // Id: "mock",
1283 // Driver: common.DriverMemory,
1284 // Memory: &common.MemoryConnectorConfig{
1285 // MaxItems: 100_000, MaxTotalSize: "1GB",
1286 // },
1287 // },
1288 // },
1289 // Policies: []*common.CachePolicyConfig{
1290 // {
1291 // Network: "*",
1292 // Method: "*",
1293 // TTL: common.FixedDuration(5 * time.Minute),
1294 // },
1295 // },
1296 // },
1297 // }
1298 // },
1299 // },
1300 // {
1301 // name: "CachingDisabled",
1302 // configure: func(cfg *common.Config) {
1303 // cfg.Database = &common.DatabaseConfig{
1304 // EvmJsonRpcCache: nil,
1305 // }
1306 // },
1307 // },

Callers

nothing calls this directly

Calls 7

ResetGockFunction · 0.92
DurationTypeAlias · 0.92
AssertNoPendingMocksFunction · 0.92
createServerTestFixturesFunction · 0.85
PtrMethod · 0.80
RunMethod · 0.65

Tested by

no test coverage detected