lbry.go/util/disk_space_test.go
Niko Storni 788857d2c3
add disk space check
remove unneeded panics
improve error handling
add tests
fix error checking that was comparing for exact values
sort imports
2018-07-12 08:24:43 -04:00

21 lines
360 B
Go

package util
import (
"os/user"
"testing"
)
func TestGetUsedSpace(t *testing.T) {
usr, err := user.Current()
if err != nil {
t.Error(err)
}
usedPctile, err := GetUsedSpace(usr.HomeDir + "/.lbrynet/blobfiles/")
if err != nil {
t.Error(err)
}
if usedPctile > 1 {
t.Errorf("over 1: %.2f", usedPctile)
}
t.Logf("used space: %.2f", usedPctile)
}