cmd/syncthing: Add mock types for API service testing
This commit is contained in:
committed by
Audrius Butkevicius
parent
a28f890e83
commit
52c74ad866
@@ -175,3 +175,23 @@ func TestDirNames(t *testing.T) {
|
||||
t.Errorf("Unexpected dirNames return: %#v\n%s", names, diff)
|
||||
}
|
||||
}
|
||||
|
||||
func TestInstantiateAPIService(t *testing.T) {
|
||||
model := new(mockedModel)
|
||||
cfg := new(mockedConfig)
|
||||
httpsCertFile := "../../test/h1/https-cert.pem"
|
||||
httpsKeyFile := "../../test/h1/https-key.pem"
|
||||
assetDir := "../../gui"
|
||||
eventSub := new(mockedEventSub)
|
||||
discoverer := new(mockedCachingMux)
|
||||
relayService := new(mockedRelayService)
|
||||
errorLog := new(mockedLoggerRecorder)
|
||||
systemLog := new(mockedLoggerRecorder)
|
||||
|
||||
svc, err := newAPIService(protocol.LocalDeviceID, cfg, httpsCertFile, httpsKeyFile, assetDir, model,
|
||||
eventSub, discoverer, relayService, errorLog, systemLog)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
_ = svc
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user