File tree Expand file tree Collapse file tree 1 file changed +10
-16
lines changed
Expand file tree Collapse file tree 1 file changed +10
-16
lines changed Original file line number Diff line number Diff line change 11#!/usr/bin/env python
22
3- from pathlib import Path
43import asn1tools
4+ import glob
55import os
66import sys
77
88script_dir = os .path .dirname (os .path .abspath (__file__ ))
99sys .path .append (os .path .abspath (os .path .join (script_dir , '../jam-types-asn' )))
10- print (sys .path )
10+
11+ from utils import get_schema_files , validate # noqa: E402
1112
1213os .chdir (script_dir )
1314
14- from utils import get_schema_files , validate
15+ def validate_spec (spec_name , is_full ):
16+ print (f"[Validating '{ spec_name } ' spec]" )
17+ schema = asn1tools .compile_files (get_schema_files (is_full ), codec = "jer" )
18+ for json_file in glob .glob (f"{ spec_name } /*.json" ):
19+ validate (schema , json_file )
1520
16- # Validate tiny
17- print ("[Validating Tiny Spec]" )
18- schema = asn1tools .compile_files (get_schema_files (False ), codec = "jer" )
19- for path in Path ("tiny" ).iterdir ():
20- if path .is_file () and path .suffix == ".json" :
21- validate (schema , path )
22-
23- # Validate full
24- print ("[Validating Full Spec]" )
25- schema = asn1tools .compile_files (get_schema_files (True ), codec = "jer" )
26- for path in Path ("full" ).iterdir ():
27- if path .is_file () and path .suffix == ".json" :
28- validate (schema , path )
21+ validate_spec ("tiny" , False )
22+ validate_spec ("full" , True )
You can’t perform that action at this time.
0 commit comments