RaspberryPi-Samples / py-my-key

Access control with RaspberryPi and NFC card reader
ISC License
1 stars 1 forks source link

Speedup unit tests #15

Closed scls19fr closed 8 years ago

scls19fr commented 8 years ago

Unit tests are quite slow because of delay with lock

setting time_opened using in test_000_something

    my_app.hw.lock.time_opened = 0

could fix it

scls19fr commented 8 years ago

BaseReader have some time.sleep calls https://github.com/RaspberryPi-Samples/py-my-key/blob/Led_management/py_my_key/readers.py

We should define at initialize a time_to_sleep (or tts) attribute.

TestReader should have time_to_sleep (or tts) attribute set to 0.

lwalter86 commented 8 years ago

tts is set I have set up the time_opened parametter in the test too. Finally, I have defined a "waiting for a card" (wfc) variable to set it up to 0 for the test, but... see #21