From ded1028d646bc5d6238ac496f9915428a431e134 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Fri, 6 Dec 2024 10:56:13 +0800 Subject: [PATCH] update Signed-off-by: Bo-Yi Wu --- easyssh_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/easyssh_test.go b/easyssh_test.go index c251a4f..eb732fc 100644 --- a/easyssh_test.go +++ b/easyssh_test.go @@ -1,6 +1,7 @@ package easyssh import ( + "context" "os" "os/user" "path" @@ -508,5 +509,6 @@ func TestCommandTimeout(t *testing.T) { assert.Equal(t, "root\n", outStr) assert.Equal(t, "", errStr) assert.False(t, isTimeout) - assert.NoError(t, err) + assert.NotNil(t, err) + assert.Equal(t, "Run Command Timeout: "+context.DeadlineExceeded.Error(), err.Error()) }