cmd/syncthing: Extract interfaces for things the API depends on

Enables testing of the API service, in the long run.
This commit is contained in:
Jakob Borg
2016-03-21 19:36:08 +00:00
parent 894ccd18ff
commit a492cfba13
10 changed files with 112 additions and 51 deletions

View File

@@ -33,7 +33,7 @@ func TestCacheUnique(t *testing.T) {
relays := []Relay{{URL: "relay://192.0.2.44:443"}, {URL: "tcp://192.0.2.45:443"}}
c := NewCachingMux()
c.ServeBackground()
c.(*cachingMux).ServeBackground()
defer c.Stop()
// Add a fake discovery service and verify we get it's answers through the
@@ -94,7 +94,7 @@ func (f *fakeDiscovery) Cache() map[protocol.DeviceID]CacheEntry {
func TestCacheSlowLookup(t *testing.T) {
c := NewCachingMux()
c.ServeBackground()
c.(*cachingMux).ServeBackground()
defer c.Stop()
// Add a slow discovery service.