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

Function TestLoggingDelete

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

Source from the content-addressed store, hash-verified

89}
90
91func TestLoggingDelete(t *testing.T, s Server) {
92 key := ari.NewKey(ari.LoggingKey, "n1")
93
94 runTest("ok", t, s, func(t *testing.T, m *mock, cl ari.Client) {
95 m.Logging.On("Delete", key).Return(nil)
96
97 err := cl.Asterisk().Logging().Delete(key)
98 if err != nil {
99 t.Errorf("Unexpected error in logging Delete: %s", err)
100 }
101
102 m.Logging.AssertCalled(t, "Delete", key)
103 })
104
105 runTest("err", t, s, func(t *testing.T, m *mock, cl ari.Client) {
106 m.Logging.On("Delete", key).Return(errors.New("error"))
107
108 err := cl.Asterisk().Logging().Delete(key)
109 if err == nil {
110 t.Errorf("Expected error in logging Delete")
111 }
112
113 m.Logging.AssertCalled(t, "Delete", key)
114 })
115}
116
117func TestLoggingRotate(t *testing.T, s Server) {
118 key := ari.NewKey(ari.LoggingKey, "n1")

Callers 2

TestLoggingDeleteFunction · 0.92
TestLoggingDeleteFunction · 0.92

Calls 5

runTestFunction · 0.85
LoggingMethod · 0.80
AsteriskMethod · 0.80
NewMethod · 0.80
DeleteMethod · 0.45

Tested by

no test coverage detected