tests.conftest
Configure tests and define test fixtures.
1"""Configure tests and define test fixtures.""" 2 3from __future__ import annotations 4 5from typing import TYPE_CHECKING 6 7import pytest 8 9if TYPE_CHECKING: # pragma: no cover 10 from unittest.mock import MagicMock 11 12 from pytest_mock import MockerFixture 13 14 15@pytest.fixture 16def mock_send_rc0(mocker: MockerFixture) -> MagicMock: 17 """Mock the `dicom_echo.__send` function with a return code of `0`.""" 18 return mocker.patch('dicom_echo.__send', return_value=0) 19 20 21@pytest.fixture 22def mock_send_rc1(mocker: MockerFixture) -> MagicMock: 23 """Mock the `dicom_echo.__send` function with a return code of `1`.""" 24 return mocker.patch('dicom_echo.__send', return_value=1)
16@pytest.fixture 17def mock_send_rc0(mocker: MockerFixture) -> MagicMock: 18 """Mock the `dicom_echo.__send` function with a return code of `0`.""" 19 return mocker.patch('dicom_echo.__send', return_value=0)
Mock the dicom_echo.__send
function with a return code of 0
.
22@pytest.fixture 23def mock_send_rc1(mocker: MockerFixture) -> MagicMock: 24 """Mock the `dicom_echo.__send` function with a return code of `1`.""" 25 return mocker.patch('dicom_echo.__send', return_value=1)
Mock the dicom_echo.__send
function with a return code of 1
.