diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2020-08-18 20:21:46 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2020-08-18 20:21:46 +0000 |
commit | bddee63922e227c73fd1b4e5b50bbef56bb9a61f (patch) | |
tree | ee729b4d2250e2935a4922f120637a68ed91db17 /tests/conftest.py | |
parent | Initial commit. (diff) | |
download | gita-bddee63922e227c73fd1b4e5b50bbef56bb9a61f.tar.xz gita-bddee63922e227c73fd1b4e5b50bbef56bb9a61f.zip |
Adding upstream version 0.10.9.upstream/0.10.9
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | tests/conftest.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 0000000..b3e59ed --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,26 @@ +from pathlib import Path +from unittest.mock import MagicMock + +TEST_DIR = Path(__file__).parents[0] + + +def fullpath(fname: str): + return str(TEST_DIR / fname) + + +PATH_FNAME = fullpath('mock_path_file') +PATH_FNAME_EMPTY = fullpath('empty_path_file') +PATH_FNAME_CLASH = fullpath('clash_path_file') +GROUP_FNAME = fullpath('mock_group_file') + +def async_mock(): + """ + Mock an async function. The calling arguments are saved in a MagicMock. + """ + m = MagicMock() + + async def coro(*args, **kwargs): + return m(*args, **kwargs) + + coro.mock = m + return coro |