mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-17 17:42:20 +03:00
tests: journal_lock: Finale factory change fixups & cleanup
* `test_release_lock()` needed `.getbasetemp()` on `mock_journaldir` usage. * Add removal of lock file to `other_process_lock()`
This commit is contained in:
parent
34f1989b0b
commit
725473e2db
@ -69,6 +69,9 @@ def other_process_lock(continue_q: mp.Queue, exit_q: mp.Queue, lockfile: pathlib
|
||||
print('sub-process: Waiting for exit signal...')
|
||||
exit_q.get(block=True, timeout=None)
|
||||
|
||||
# And clean up
|
||||
os.unlink(lockfile / 'edmc-journal-lock.txt')
|
||||
|
||||
|
||||
def _obtain_lock(prefix: str, filehandle) -> bool:
|
||||
"""
|
||||
@ -311,7 +314,7 @@ class TestJournalLock:
|
||||
assert jlock.release_lock()
|
||||
|
||||
# And finally check it actually IS unlocked.
|
||||
with open(mock_journaldir / 'edmc-journal-lock.txt', mode='w+') as lf:
|
||||
with open(mock_journaldir.getbasetemp() / 'edmc-journal-lock.txt', mode='w+') as lf:
|
||||
assert _obtain_lock('release-lock', lf)
|
||||
|
||||
# Cleanup, to avoid side-effect on other tests
|
||||
|
Loading…
x
Reference in New Issue
Block a user