def test_invalid(self, mocker): """Test an invalid attribute type.""" mock_geometry = mocker.MagicMock(spec=hou.Geometry) mock_name = mocker.MagicMock(spec=str) with pytest.raises(ValueError): utils.find_attrib(mock_geometry, None, mock_name)
def test_point(self): mock_geometry = MagicMock(spec=hou.Geometry) mock_name = MagicMock(spec=str) result = utils.find_attrib(mock_geometry, hou.attribType.Point, mock_name) self.assertEqual(result, mock_geometry.findPointAttrib.return_value) mock_geometry.findPointAttrib.assert_called_with(mock_name)
def test_point(self, mocker): mock_geometry = mocker.MagicMock(spec=hou.Geometry) mock_name = mocker.MagicMock(spec=str) result = utils.find_attrib(mock_geometry, hou.attribType.Point, mock_name) assert result == mock_geometry.findPointAttrib.return_value mock_geometry.findPointAttrib.assert_called_with(mock_name)
def test_invalid(self): mock_geometry = MagicMock(spec=hou.Geometry) mock_name = MagicMock(spec=str) with self.assertRaises(ValueError): utils.find_attrib(mock_geometry, None, mock_name)