mirror of
https://github.com/zrepl/zrepl.git
synced 2024-11-28 19:34:58 +01:00
22 lines
437 B
Go
22 lines
437 B
Go
package zfs
|
|
|
|
import (
|
|
"github.com/stretchr/testify/assert"
|
|
"testing"
|
|
)
|
|
|
|
func TestZFSListHandlesProducesZFSErrorOnNonZeroExit(t *testing.T) {
|
|
var err error
|
|
|
|
ZFS_BINARY = "./test_helpers/zfs_failer.sh"
|
|
|
|
_, err = zfsList("nonexistent/dataset", func(p DatasetPath) bool {
|
|
return true
|
|
})
|
|
|
|
assert.Error(t, err)
|
|
zfsError, ok := err.(ZFSError)
|
|
assert.True(t, ok)
|
|
assert.Equal(t, "error: this is a mock\n", string(zfsError.Stderr))
|
|
}
|