def test_error(self, mocker): mock_properties = mocker.MagicMock(spec=list) mock_stage = mocker.MagicMock(spec=str) mock_rendertype = mocker.MagicMock(spec=str) mock_name = mocker.MagicMock(spec=str) property_block = { mock_name: mocker.MagicMock() } with pytest.raises(TypeError): setproperties._process_rendertype_block(mock_properties, mock_stage, mock_rendertype, property_block)
def test_error(self): mock_properties = MagicMock(spec=list) mock_stage = MagicMock(spec=str) mock_rendertype = MagicMock(spec=str) mock_name = MagicMock(spec=str) property_block = { mock_name: MagicMock() } with self.assertRaises(TypeError): setproperties._process_rendertype_block(mock_properties, mock_stage, mock_rendertype, property_block)
def test_list(self, mock_process): mock_properties = MagicMock(spec=list) mock_stage = MagicMock(spec=str) mock_rendertype = MagicMock(spec=str) mock_name = MagicMock(spec=str) block = {} property_block = { mock_name: [block] } setproperties._process_rendertype_block(mock_properties, mock_stage, mock_rendertype, property_block) mock_process.assert_called_with(mock_properties, mock_stage, mock_name, [{"rendertype": mock_rendertype}])
def test_list(self, mocker): mock_process = mocker.patch("ht.pyfilter.operations.setproperties._process_block") mock_properties = mocker.MagicMock(spec=list) mock_stage = mocker.MagicMock(spec=str) mock_rendertype = mocker.MagicMock(spec=str) mock_name = mocker.MagicMock(spec=str) block = {} property_block = { mock_name: [block] } setproperties._process_rendertype_block(mock_properties, mock_stage, mock_rendertype, property_block) mock_process.assert_called_with(mock_properties, mock_stage, mock_name, [{"rendertype": mock_rendertype}])