File: conftest.py

package info (click to toggle)
freedombox 26.3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 83,092 kB
  • sloc: python: 48,542; javascript: 1,730; xml: 481; makefile: 290; sh: 137; php: 32
file content (23 lines) | stat: -rw-r--r-- 571 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
pytest configuration for all tests in the plinth/tests/ directory.
"""

import pathlib
from unittest.mock import patch

import pytest

from plinth import cfg


@pytest.fixture(name='shortcuts_file')
def fixture_shortcuts_file():
    with patch('plinth.frontpage.get_custom_shortcuts_paths') as func:

        def setter(file_name):
            path = pathlib.Path(__file__).parent / 'data' / 'shortcuts'
            path /= file_name
            func.return_value = cfg.expand_to_dot_d_paths([path])

        yield setter