File tree Expand file tree Collapse file tree 2 files changed +0
-22
lines changed
Expand file tree Collapse file tree 2 files changed +0
-22
lines changed Original file line number Diff line number Diff line change 22
33from __future__ import annotations
44
5- import json
65from typing import TYPE_CHECKING
76
87import yaml
@@ -30,13 +29,6 @@ def from_file(cls, path: Path) -> BuildSpecification:
3029 with path .open ("r" , encoding = "utf-8" ) as f :
3130 return BuildSpecification (** yaml .safe_load (f ))
3231
33- @classmethod
34- def to_json_schema_file (cls , path : Path ) -> None :
35- """Write JSON schema to file."""
36- with path .open ("w" ) as f :
37- schema = cls .model_json_schema ()
38- json .dump (schema , f )
39-
4032 model_config = ConfigDict (
4133 extra = "forbid" ,
4234 use_attribute_docstrings = True ,
Original file line number Diff line number Diff line change 22
33from __future__ import annotations
44
5- import json
65from pathlib import Path
76
87import pytest
@@ -100,16 +99,3 @@ def test_from_toml(tmp_path: Path) -> None:
10099 assert spec .loader .kind == "json"
101100 assert len (spec .generators ) == 2
102101 assert spec .generators ["vlog" ].kind == "verilog"
103-
104-
105- def test_to_json_schema (tmp_path : Path ) -> None :
106- """Test writing JSON schema to file."""
107- schema_file = tmp_path / "schema.json"
108- csr .BuildSpecification .to_json_schema_file (schema_file )
109-
110- with schema_file .open () as f :
111- schema = json .load (f )
112-
113- assert schema ["title" ] == "BuildSpecification"
114- assert "loader" in schema ["properties" ]
115- assert "generators" in schema ["properties" ]
You can’t perform that action at this time.
0 commit comments