Remove duplicate fixture from bsblan (#104612)
This commit is contained in:
parent
b994141bc6
commit
7efc581a48
2 changed files with 10 additions and 20 deletions
|
@ -38,25 +38,15 @@ def mock_setup_entry() -> Generator[AsyncMock, None, None]:
|
|||
yield mock_setup
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_bsblan_config_flow() -> Generator[None, MagicMock, None]:
|
||||
"""Return a mocked BSBLAN client."""
|
||||
with patch(
|
||||
"homeassistant.components.bsblan.config_flow.BSBLAN", autospec=True
|
||||
) as bsblan_mock:
|
||||
bsblan = bsblan_mock.return_value
|
||||
bsblan.device.return_value = Device.parse_raw(
|
||||
load_fixture("device.json", DOMAIN)
|
||||
)
|
||||
bsblan.info.return_value = Info.parse_raw(load_fixture("info.json", DOMAIN))
|
||||
yield bsblan
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_bsblan(request: pytest.FixtureRequest) -> Generator[None, MagicMock, None]:
|
||||
"""Return a mocked BSBLAN client."""
|
||||
|
||||
with patch("homeassistant.components.bsblan.BSBLAN", autospec=True) as bsblan_mock:
|
||||
with patch(
|
||||
"homeassistant.components.bsblan.BSBLAN", autospec=True
|
||||
) as bsblan_mock, patch(
|
||||
"homeassistant.components.bsblan.config_flow.BSBLAN", new=bsblan_mock
|
||||
):
|
||||
bsblan = bsblan_mock.return_value
|
||||
bsblan.info.return_value = Info.parse_raw(load_fixture("info.json", DOMAIN))
|
||||
bsblan.device.return_value = Device.parse_raw(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue