star/gdu/tui/actions_linux_test.go
2025-04-26 19:33:14 +08:00

26 lines
561 B
Go

//go:build linux
// +build linux
package tui
import (
"bytes"
"testing"
"b612.me/apps/b612/gdu/internal/testapp"
"b612.me/apps/b612/gdu/pkg/device"
"github.com/stretchr/testify/assert"
)
func TestShowDevicesWithError(t *testing.T) {
app, simScreen := testapp.CreateTestAppWithSimScreen(50, 50)
defer simScreen.Fini()
getter := device.LinuxDevicesInfoGetter{MountsPath: "/xyzxyz"}
ui := CreateUI(app, simScreen, &bytes.Buffer{}, false, false, false, false, false)
err := ui.ListDevices(getter)
assert.Contains(t, err.Error(), "no such file")
}