conejoninja / tesoro

Go package for TREZOR devices
Other
11 stars 5 forks source link

tesoro_test.go:29:4: undefined: client #5

Closed rfjakob closed 6 years ago

rfjakob commented 6 years ago

Trying to run the tests, the bootloader tests work:

~/go/src/github.com/conejoninja/tesoro/tests$ go test -v tesoro_bootloader_test.go
Found 1 TREZOR devices connected
=== RUN   TestBLInitialize
--- PASS: TestBLInitialize (0.00s)
    tesoro_bootloader_test.go:47: We need to check if device is in bootloader mode.
    tesoro_bootloader_test.go:62:       Everything went fine, \ʕ◔ϖ◔ʔ/ YAY!
=== RUN   TestBLFirmwareUpload
[WHAT TO DO] Erase firmware, click "Continue"
[WHAT TO DO] Check fingerprint match: 5764715dbcf8ed88bc0ae1c2f715277f22b67f26c15e1f7543b2b44913b5c255 and click "Continue" 
--- PASS: TestBLFirmwareUpload (25.08s)
    tesoro_bootloader_test.go:71: We'll try to upload a new firmware.
    tesoro_bootloader_test.go:104:      Everything went fine, \ʕ◔ϖ◔ʔ/ YAY!
PASS
ok      command-line-arguments  25.189s

But the normal mode tests fail with compile errors:

~/go/src/github.com/conejoninja/tesoro/tests$ go test -v tesoro_test.go
# command-line-arguments
./tesoro_test.go:29:4: undefined: client
./tesoro_test.go:51:32: undefined: client
./tesoro_test.go:76:32: undefined: client
./tesoro_test.go:102:32: undefined: client
./tesoro_test.go:123:30: undefined: client
./tesoro_test.go:140:30: undefined: client
./tesoro_test.go:157:30: undefined: client
./tesoro_test.go:175:32: undefined: client
./tesoro_test.go:199:30: undefined: client
./tesoro_test.go:208:31: undefined: client
./tesoro_test.go:208:31: too many errors
FAIL    command-line-arguments [build failed]
xaionaro commented 6 years ago

It seems it's enough to just to uncomment the line: https://github.com/conejoninja/tesoro/blob/master/tests/tesoro_test.go#L15

rfjakob commented 6 years ago

This fixes the compile error, but one test fails:

=== RUN   TestPingButtonCancel
[WHAT TO DO] Click on "Cancel"
--- FAIL: TestPingButtonCancel (2.20s)
    tesoro_test.go:98: We need to test the PING.
    tesoro_test.go:100:     Checking PING for response "PONG"
    tesoro_test.go:109:         Expected str="Ping cancelled", received"Action cancelled by user"