1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-15 08:40:34 +03:00

Rename mock_get_str() to mock_journaldir()

This commit is contained in:
Athanasius 2021-03-19 14:24:25 +00:00
parent a325c62765
commit 509a1f2c2e

View File

@ -44,8 +44,8 @@ from journal_lock import JournalLock
@pytest.fixture
def mock_get_str(monkeypatch: _pytest_monkeypatch, tmpdir: _pytest_tmpdir) -> py_path_local_LocalPath:
"""Fixture for get_str() mock setup."""
def mock_journaldir(monkeypatch: _pytest_monkeypatch, tmpdir: _pytest_tmpdir) -> py_path_local_LocalPath:
"""Fixture for mocking config.get_str('journaldir')."""
def get_str(key: str, *, default: str = None) -> str:
"""Mock config.*Config get_str to provide fake journaldir."""
if key == 'journaldir':
@ -60,9 +60,9 @@ def mock_get_str(monkeypatch: _pytest_monkeypatch, tmpdir: _pytest_tmpdir) -> py
yield tmpdir
def test_journal_lock_init(mock_get_str: py_path_local_LocalPath):
def test_journal_lock_init(mock_journaldir: py_path_local_LocalPath):
"""Test JournalLock instantiation."""
tmpdir = mock_get_str
tmpdir = mock_journaldir
jlock = JournalLock()
assert jlock.journal_dir == str(tmpdir)