MCPcopy
hub / github.com/keploy/keploy / TestEffectiveStreamMockWindow_327

Function TestEffectiveStreamMockWindow_327

pkg/service/replay/utils_test.go:86–106  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

84}
85
86func TestEffectiveStreamMockWindow_327(t *testing.T) {
87 reqTs := time.Date(2026, 2, 20, 9, 31, 7, 83000000, time.UTC)
88 respTs := reqTs.Add(3255 * time.Microsecond)
89 tc := &models.TestCase{
90 Kind: models.HTTP,
91 HTTPReq: models.HTTPReq{
92 Timestamp: reqTs,
93 },
94 HTTPResp: models.HTTPResp{
95 Timestamp: respTs,
96 },
97 }
98
99 after, before := effectiveStreamMockWindow(tc, 5)
100 assert.Equal(t, reqTs, after)
101 assert.Equal(t, respTs.Add(11*time.Second), before)
102
103 after, before = effectiveStreamMockWindow(tc, 30)
104 assert.Equal(t, reqTs, after)
105 assert.Equal(t, respTs.Add(30*time.Second), before)
106}
107
108func TestIsMockSubsetWithConfig(t *testing.T) {
109 tests := []struct {

Callers

nothing calls this directly

Calls 2

AddMethod · 0.80

Tested by

no test coverage detected