mirror of
https://github.com/zrepl/zrepl.git
synced 2024-11-22 08:23:50 +01:00
20 lines
419 B
Go
20 lines
419 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([]string{"fictionalprop"}, "nonexistent/dataset")
|
|
|
|
assert.Error(t, err)
|
|
zfsError, ok := err.(ZFSError)
|
|
assert.True(t, ok)
|
|
assert.Equal(t, "error: this is a mock\n", string(zfsError.Stderr))
|
|
}
|