@@ -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{}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user