MCPcopy Create free account
hub / github.com/CyCoreSystems/ari-proxy / TestLoggingRotate

Function TestLoggingRotate

internal/integration/logging.go:117–141  ·  view source on GitHub ↗
(t *testing.T, s Server)

Source from the content-addressed store, hash-verified

115}
116
117func TestLoggingRotate(t *testing.T, s Server) {
118 key := ari.NewKey(ari.LoggingKey, "n1")
119
120 runTest("ok", t, s, func(t *testing.T, m *mock, cl ari.Client) {
121 m.Logging.On("Rotate", key).Return(nil)
122
123 err := cl.Asterisk().Logging().Rotate(key)
124 if err != nil {
125 t.Errorf("Unexpected error in logging Rotate: %s", err)
126 }
127
128 m.Logging.AssertCalled(t, "Rotate", key)
129 })
130
131 runTest("err", t, s, func(t *testing.T, m *mock, cl ari.Client) {
132 m.Logging.On("Rotate", key).Return(errors.New("error"))
133
134 err := cl.Asterisk().Logging().Rotate(key)
135 if err == nil {
136 t.Errorf("Expected error in logging Rotate")
137 }
138
139 m.Logging.AssertCalled(t, "Rotate", key)
140 })
141}

Callers 2

TestLoggingRotateFunction · 0.92
TestLoggingRotateFunction · 0.92

Calls 5

runTestFunction · 0.85
RotateMethod · 0.80
LoggingMethod · 0.80
AsteriskMethod · 0.80
NewMethod · 0.80

Tested by

no test coverage detected