Implemented unit tests
This commit is contained in:
parent
3c3bec5a5e
commit
dbdcd21780
7 changed files with 1111 additions and 1 deletions
68
how-to-create-encrypted-paper-backup/tests/electrum.exp
Normal file
68
how-to-create-encrypted-paper-backup/tests/electrum.exp
Normal file
|
@ -0,0 +1,68 @@
|
|||
#!/usr/bin/expect
|
||||
|
||||
# exp_internal 1
|
||||
# log_file -noappend ~/expect.log
|
||||
|
||||
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]"
|
||||
|
||||
spawn qr-backup.sh --create-electrum-mnemonic
|
||||
|
||||
expect {
|
||||
default {
|
||||
puts $failed
|
||||
exit 1
|
||||
}
|
||||
-re {Format USB flash drive \(y or n\)\?} {
|
||||
send "n\r"
|
||||
}
|
||||
}
|
||||
|
||||
expect {
|
||||
default {
|
||||
puts $failed
|
||||
exit 1
|
||||
}
|
||||
-re {\[sudo\] password for pi:} {
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
interact
|
Loading…
Add table
Add a link
Reference in a new issue