Ensure tests pass now that we're passing fstype around

This commit is contained in:
Simon Fraser 2015-08-10 21:08:21 +01:00
parent d5cca82df8
commit e90705567d
2 changed files with 4 additions and 1 deletions

View File

@ -59,6 +59,7 @@ func TestDisk_io_counters(t *testing.T) {
func TestDiskUsageStat_String(t *testing.T) {
v := DiskUsageStat{
Path: "/",
Fstype: "ext4",
Total: 1000,
Free: 2000,
Used: 3000,
@ -68,7 +69,7 @@ func TestDiskUsageStat_String(t *testing.T) {
InodesFree: 6000,
InodesUsedPercent: 49.1,
}
e := `{"path":"/","total":1000,"free":2000,"used":3000,"used_percent":50.1,"inodes_total":4000,"inodes_used":5000,"inodes_free":6000,"inodes_used_percent":49.1}`
e := `{"path":"/","fstype":"ext4","total":1000,"free":2000,"used":3000,"used_percent":50.1,"inodes_total":4000,"inodes_used":5000,"inodes_free":6000,"inodes_used_percent":49.1}`
if e != fmt.Sprintf("%v", v) {
t.Errorf("DiskUsageStat string is invalid: %v", v)
}

View File

@ -48,6 +48,7 @@ func TestSystemStats_GenerateStats(t *testing.T) {
du := &disk.DiskUsageStat{
Path: "/",
Fstype: "ext4",
Total: 128,
Free: 23,
InodesTotal: 1234,
@ -196,6 +197,7 @@ func TestSystemStats_GenerateStats(t *testing.T) {
tags := map[string]string{
"path": "/",
"fstype": "ext4",
}
assert.True(t, acc.CheckTaggedValue("total", uint64(128), tags))