Set up test fixtures.
(self)
| 40 | """Test cases for the JSON plugin with new outlines API.""" |
| 41 | |
| 42 | def setUp(self): |
| 43 | """Set up test fixtures.""" |
| 44 | # Sample JSON schemas for testing |
| 45 | self.simple_schema = json.dumps({ |
| 46 | "type": "object", |
| 47 | "properties": { |
| 48 | "name": {"type": "string"}, |
| 49 | "age": {"type": "integer"}, |
| 50 | "active": {"type": "boolean"} |
| 51 | }, |
| 52 | "required": ["name", "age"] |
| 53 | }) |
| 54 | |
| 55 | self.complex_schema = json.dumps({ |
| 56 | "type": "object", |
| 57 | "properties": { |
| 58 | "id": {"type": "integer"}, |
| 59 | "email": {"type": "string"}, |
| 60 | "score": {"type": "number"}, |
| 61 | "tags": {"type": "array"}, |
| 62 | "metadata": {"type": "object"} |
| 63 | }, |
| 64 | "required": ["id", "email"] |
| 65 | }) |
| 66 | |
| 67 | @patch('optillm.plugins.json_plugin.outlines.from_transformers') |
| 68 | @patch('optillm.plugins.json_plugin.AutoTokenizer.from_pretrained') |
nothing calls this directly
no outgoing calls
no test coverage detected