test: refactor codebase to improve performance and readability

- Remove debug command block from `TestSudoCommand` test

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu 2024-07-14 15:02:35 +08:00
parent f3ec458f57
commit ce7d47c250
No known key found for this signature in database

View File

@ -918,9 +918,6 @@ func TestSudoCommand(t *testing.T) {
var (
buffer bytes.Buffer
expected = `
======CMD======
sudo su - -c "whoami"
======END======
out: root
`
)
@ -936,7 +933,6 @@ func TestSudoCommand(t *testing.T) {
},
CommandTimeout: 10 * time.Second,
RequireTty: true,
Debug: true,
},
Writer: &buffer,
}