MCPcopy Index your code
hub / github.com/PDFMathTranslate/PDFMathTranslate / setUp

Method setUp

test/test_doclayout.py:14–25  ·  view source on GitHub ↗
(self, mock_inference_session, mock_onnx_load)

Source from the content-addressed store, hash-verified

12 @patch("onnx.load")
13 @patch("onnxruntime.InferenceSession")
14 def setUp(self, mock_inference_session, mock_onnx_load):
15 # Mock ONNX model metadata
16 mock_model = MagicMock()
17 mock_model.metadata_props = [
18 MagicMock(key="stride", value="32"),
19 MagicMock(key="names", value="['class1', 'class2']"),
20 ]
21 mock_onnx_load.return_value = mock_model
22
23 # Initialize OnnxModel with a fake path
24 self.model_path = "fake_model_path.onnx"
25 self.model = OnnxModel(self.model_path)
26
27 def test_stride_property(self):
28 # Test that stride is correctly set from model metadata

Callers

nothing calls this directly

Calls 1

OnnxModelClass · 0.90

Tested by

no test coverage detected