mirror of
https://github.com/markqvist/rnsh.git
synced 2025-05-10 10:05:17 -04:00
Test improvements
This commit is contained in:
parent
2b3089ddd5
commit
1f31307307
3 changed files with 24 additions and 11 deletions
|
@ -1,4 +1,5 @@
|
|||
import logging
|
||||
import time
|
||||
import types
|
||||
import typing
|
||||
import tempfile
|
||||
|
@ -147,4 +148,16 @@ def test_config_and_cleanup():
|
|||
assert filedata.index("acehoss test config") > 0
|
||||
with pytest.raises(ValueError):
|
||||
filedata.index("22222")
|
||||
assert not os.path.exists(os.path.join(td, "config"))
|
||||
assert not os.path.exists(os.path.join(td, "config"))
|
||||
|
||||
|
||||
def wait_for_condition(condition: callable, timeout: float):
|
||||
tm = time.time() + timeout
|
||||
while tm > time.time() and not condition():
|
||||
time.sleep(0.01)
|
||||
|
||||
|
||||
async def wait_for_condition_async(condition: callable, timeout: float):
|
||||
tm = time.time() + timeout
|
||||
while tm > time.time() and not condition():
|
||||
await asyncio.sleep(0.01)
|
Loading…
Add table
Add a link
Reference in a new issue