refactor: refactor test environment setup and command markers

- Add environment markers to `TestCommandOutput` for localhost and 127.0.0.1
- Remove command markers from `TestFingerprint`

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

View File

@ -365,6 +365,9 @@ func TestCommandOutput(t *testing.T) {
whoami
uname
localhost: ======END======
localhost: ======ENV======
localhost:
localhost: ======END======
localhost: out: /home/drone-scp
localhost: out: drone-scp
localhost: out: Linux
@ -373,6 +376,9 @@ func TestCommandOutput(t *testing.T) {
whoami
uname
127.0.0.1: ======END======
127.0.0.1: ======ENV======
127.0.0.1:
127.0.0.1: ======END======
127.0.0.1: out: /home/drone-scp
127.0.0.1: out: drone-scp
127.0.0.1: out: Linux
@ -444,9 +450,6 @@ func TestFingerprint(t *testing.T) {
var (
buffer bytes.Buffer
expected = `
======CMD======
whoami
======END======
out: drone-scp
`
)