lib/model: Small fixes to test convenience functions (#5128)

This commit is contained in:
Simon Frei
2018-08-16 12:11:48 +02:00
committed by GitHub
parent f6da436f4b
commit 9028969617
3 changed files with 115 additions and 71 deletions

View File

@@ -54,11 +54,11 @@ func expectTimeout(w *events.Subscription, t *testing.T) {
func TestProgressEmitter(t *testing.T) {
w := events.Default.Subscribe(events.DownloadProgress)
c, path := createTmpWrapper(config.Configuration{})
c := createTmpWrapper(config.Configuration{})
defer os.Remove(c.ConfigPath())
c.SetOptions(config.OptionsConfiguration{
ProgressUpdateIntervalS: 0,
})
defer os.Remove(path)
p := NewProgressEmitter(c)
go p.Serve()
@@ -103,12 +103,12 @@ func TestProgressEmitter(t *testing.T) {
}
func TestSendDownloadProgressMessages(t *testing.T) {
c, path := createTmpWrapper(config.Configuration{})
c := createTmpWrapper(config.Configuration{})
defer os.Remove(c.ConfigPath())
c.SetOptions(config.OptionsConfiguration{
ProgressUpdateIntervalS: 0,
TempIndexMinBlocks: 10,
})
defer os.Remove(path)
fc := &fakeConnection{}