Skip to content

Commit

Permalink
Only mock with IOC test for now
Browse files Browse the repository at this point in the history
  • Loading branch information
callumforrester committed Apr 16, 2024
1 parent 10137fd commit 1dcb0c1
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions tests/epics/demo/test_demo.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import asyncio
import subprocess
from typing import Dict
from unittest.mock import ANY, Mock, call
from unittest.mock import ANY, Mock, call, patch

import aioca
import pytest
from bluesky.protocols import Reading

from ophyd_async.core import (
DeviceCollector,
NotConnected,
Expand Down Expand Up @@ -293,7 +292,13 @@ async def test_dynamic_sensor_group_read_and_describe(
}


async def test_ioc_starts():
pv_prefix = demo.start_ioc_subprocess()
pv = f"{pv_prefix}Value"
await aioca.connect(pv, timeout=10.0)
@patch("ophyd_async.epics.demo.subprocess.Popen")
async def test_ioc_starts(mock_popen: Mock):
demo.start_ioc_subprocess()
mock_popen.assert_called_once_with(
ANY,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
universal_newlines=True,
)

0 comments on commit 1dcb0c1

Please sign in to comment.