mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-06-12 05:12:13 +03:00
tests: journal_lock: Need <factory>.getbasetemp() and str() as necessary
This commit is contained in:
parent
9915c5435d
commit
27d93b5f31
@ -116,7 +116,7 @@ class TestJournalLock:
|
|||||||
def get_str(key: str, *, default: str = None) -> str:
|
def get_str(key: str, *, default: str = None) -> str:
|
||||||
"""Mock config.*Config get_str to provide fake journaldir."""
|
"""Mock config.*Config get_str to provide fake journaldir."""
|
||||||
if key == 'journaldir':
|
if key == 'journaldir':
|
||||||
return str(tmp_path_factory)
|
return str(tmp_path_factory.getbasetemp())
|
||||||
|
|
||||||
print('Other key, calling up ...')
|
print('Other key, calling up ...')
|
||||||
return config.get_str(key) # Call the non-mocked
|
return config.get_str(key) # Call the non-mocked
|
||||||
@ -148,7 +148,8 @@ class TestJournalLock:
|
|||||||
# Tests against JournalLock.__init__()
|
# Tests against JournalLock.__init__()
|
||||||
def test_journal_lock_init(self, mock_journaldir: py_path_local_LocalPath):
|
def test_journal_lock_init(self, mock_journaldir: py_path_local_LocalPath):
|
||||||
"""Test JournalLock instantiation."""
|
"""Test JournalLock instantiation."""
|
||||||
tmpdir = str(mock_journaldir)
|
print(f'{type(mock_journaldir)=}')
|
||||||
|
tmpdir = str(mock_journaldir.getbasetemp())
|
||||||
|
|
||||||
jlock = JournalLock()
|
jlock = JournalLock()
|
||||||
# Check members are properly initialised.
|
# Check members are properly initialised.
|
||||||
@ -344,6 +345,8 @@ class TestJournalLock:
|
|||||||
assert jlock.journal_dir != old_journaldir
|
assert jlock.journal_dir != old_journaldir
|
||||||
assert jlock.locked
|
assert jlock.locked
|
||||||
|
|
||||||
|
assert jlock.release_lock()
|
||||||
|
|
||||||
def test_update_lock_same(self, mock_journaldir: py_path_local_LocalPath):
|
def test_update_lock_same(self, mock_journaldir: py_path_local_LocalPath):
|
||||||
"""
|
"""
|
||||||
Test JournalLock.update_lock().
|
Test JournalLock.update_lock().
|
||||||
|
Loading…
x
Reference in New Issue
Block a user