1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 07:28:10 +00:00

tests: improve Shamir persistence test

This commit is contained in:
matejcik 2019-10-22 13:55:17 +02:00
parent 5488270bc3
commit 9b827baca0

View File

@ -14,6 +14,8 @@
# You should have received a copy of the License along with this library.
# If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
import pytest
from trezorlib import device
from .. import buttons
@ -29,11 +31,16 @@ def enter_word(debug, word):
return debug.click(buttons.CONFIRM_WORD, wait=True)
@pytest.fixture
def emulator():
emu = EmulatorWrapper("core")
with emu:
yield emu
@core_only
def test_persistence():
with EmulatorWrapper("core") as emu, BackgroundDeviceHandler(
emu.client
) as device_handler:
def test_persistence(emulator):
device_handler = BackgroundDeviceHandler(emulator.client)
debug = device_handler.debuglink()
features = device_handler.features()
@ -46,12 +53,7 @@ def test_persistence():
layout = debug.click(buttons.OK, wait=True)
assert "Select number of words" in layout.text
storage = emu.storage()
device_handler.kill_task()
with EmulatorWrapper("core", storage=storage) as emu, BackgroundDeviceHandler(
emu.client
) as device_handler:
device_handler.restart(emulator)
debug = device_handler.debuglink()
features = device_handler.features()