from unittest import mock import pytest from tomcat_bec.devices.pco_edge.pcoedgecamera import PcoEdge5M @pytest.fixture() def pcocam_base(): gfcam = PcoEdge5M( "X02DA-CAM-GF2:", name="pco_edge_camera", std_daq_rest="http://example.com/rest", std_daq_ws="ws://example.com/ws", ) for component in gfcam.component_names: type.__setattr__(PcoEdge5M, component, mock.MagicMock()) yield gfcam def test_pcocam_init_raises_without_rest_ws(): with pytest.raises(ValueError) as excinfo: PcoEdge5M("X02DA-CAM-GF2:", name="pco_edge_camera") excinfo.match("std_daq_rest and std_daq_ws must be provided")