lib/fs, lib/model: Make tests caching compatible (fixes #4749) (#4804)

This commit is contained in:
Simon Frei
2018-03-13 14:03:10 +01:00
committed by Jakob Borg
parent 470ef87dd5
commit 55a7830ff9
8 changed files with 122 additions and 90 deletions

View File

@@ -8,6 +8,7 @@ package model
import (
"fmt"
"os"
"path/filepath"
"runtime"
"testing"
@@ -53,10 +54,11 @@ func expectTimeout(w *events.Subscription, t *testing.T) {
func TestProgressEmitter(t *testing.T) {
w := events.Default.Subscribe(events.DownloadProgress)
c := config.Wrap("/tmp/test", config.Configuration{})
c, path := createTmpWrapper(config.Configuration{})
c.SetOptions(config.OptionsConfiguration{
ProgressUpdateIntervalS: 0,
})
defer os.Remove(path)
p := NewProgressEmitter(c)
go p.Serve()
@@ -101,11 +103,12 @@ func TestProgressEmitter(t *testing.T) {
}
func TestSendDownloadProgressMessages(t *testing.T) {
c := config.Wrap("/tmp/test", config.Configuration{})
c, path := createTmpWrapper(config.Configuration{})
c.SetOptions(config.OptionsConfiguration{
ProgressUpdateIntervalS: 0,
TempIndexMinBlocks: 10,
})
defer os.Remove(path)
fc := &fakeConnection{}