lib/model: Various model test fixes and polish (#5528)

* lib/model: Various model test fixes and polish

Missing calls to m.Stop()
Don't fail test if temporary test dir cleanup fails

* drop lazyness
This commit is contained in:
Simon Frei
2019-02-13 19:54:04 +01:00
committed by Audrius Butkevicius
parent 5fd333e4f7
commit 905c3594b0
3 changed files with 96 additions and 160 deletions

View File

@@ -8,6 +8,7 @@ package model
import (
"fmt"
"os"
"path/filepath"
"runtime"
"testing"
@@ -51,12 +52,10 @@ func expectTimeout(w *events.Subscription, t *testing.T) {
}
func TestProgressEmitter(t *testing.T) {
testOs := &fatalOs{t}
w := events.Default.Subscribe(events.DownloadProgress)
c := createTmpWrapper(config.Configuration{})
defer testOs.Remove(c.ConfigPath())
defer os.Remove(c.ConfigPath())
c.SetOptions(config.OptionsConfiguration{
ProgressUpdateIntervalS: 0,
})
@@ -104,10 +103,8 @@ func TestProgressEmitter(t *testing.T) {
}
func TestSendDownloadProgressMessages(t *testing.T) {
testOs := &fatalOs{t}
c := createTmpWrapper(config.Configuration{})
defer testOs.Remove(c.ConfigPath())
defer os.Remove(c.ConfigPath())
c.SetOptions(config.OptionsConfiguration{
ProgressUpdateIntervalS: 0,
TempIndexMinBlocks: 10,