Refactored unit tests
This commit is contained in:
parent
aaccc14e76
commit
4980788afc
20 changed files with 876 additions and 769 deletions
|
@ -1,68 +1,29 @@
|
|||
#!/usr/bin/expect
|
||||
|
||||
# exp_internal 1
|
||||
# log_file -noappend ~/expect.log
|
||||
source ./test.exp
|
||||
|
||||
set timeout 30
|
||||
|
||||
proc bold {} {
|
||||
return [exec tput bold]
|
||||
}
|
||||
proc red {} {
|
||||
return [exec tput setaf 1]
|
||||
}
|
||||
proc green {} {
|
||||
return [exec tput setaf 2]
|
||||
}
|
||||
proc normal {} {
|
||||
return [exec tput sgr0]
|
||||
}
|
||||
|
||||
set passphrase "asdasd"
|
||||
set failed "[bold][red]Failed[normal]"
|
||||
set ok "[bold][green]OK[normal]"
|
||||
|
||||
puts "[bold]Should create Electrum mnemonic[normal]"
|
||||
test_label "Should create Electrum mnemonic"
|
||||
|
||||
spawn qr-backup.sh --create-electrum-mnemonic
|
||||
|
||||
expect {
|
||||
default {
|
||||
puts $failed
|
||||
exit 1
|
||||
}
|
||||
-re {Format USB flash drive \(y or n\)\?} {
|
||||
send "n\r"
|
||||
test_send "n\r"
|
||||
}
|
||||
}
|
||||
|
||||
expect {
|
||||
default {
|
||||
puts $failed
|
||||
exit 1
|
||||
}
|
||||
-re {\[sudo\] password for pi:} {
|
||||
send "$env(password)\r"
|
||||
test_send "$env(password)\r"
|
||||
}
|
||||
}
|
||||
|
||||
expect {
|
||||
default {
|
||||
puts $failed
|
||||
exit 1
|
||||
}
|
||||
-re {Creating Electrum mnemonic…}
|
||||
}
|
||||
|
||||
expect {
|
||||
default {
|
||||
puts $failed
|
||||
exit 1
|
||||
}
|
||||
-re {(([a-z]+ ?){24})} {
|
||||
puts $ok
|
||||
exit 0
|
||||
-re {([a-z]+ ?){24}} {
|
||||
test_ok true
|
||||
}
|
||||
}
|
||||
|
||||
interact
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue