File tree 1 file changed +26
-0
lines changed
1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,14 @@ def csl_data_validator():
44
44
return Validator (schema )
45
45
46
46
47
+ @pytest .fixture
48
+ def csl_citation_validator ():
49
+ text = root .joinpath ('schemas/input/csl-citation.json' ).read_text ()
50
+ schema = json .loads (text )
51
+ Validator = jsonschema .validators .validator_for (schema )
52
+ return Validator (schema )
53
+
54
+
47
55
"""
48
56
The following section contains the tests.
49
57
"""
@@ -83,6 +91,24 @@ def test_basic_data_schema_validates(csl_data_validator):
83
91
csl_data_validator .validate (csl )
84
92
85
93
94
+ def test_basic_citation_schema_validates (csl_citation_validator ):
95
+ cite = {
96
+ "schema" : "https://resource.citationstyles.org/schema/latest/input/json/csl-citation.json" ,
97
+ "citationID" : "item1" ,
98
+ "citationItems" : [
99
+ {
100
+ "id" : "item1" ,
101
+ "itemData" : {
102
+ "id" : "item1" ,
103
+ "type" : "book" ,
104
+ "title" : "test title"
105
+ }
106
+ }
107
+ ]
108
+ }
109
+ csl_citation_validator .validate (cite )
110
+
111
+
86
112
def test_basic_data_schema_with_author_validates (csl_data_validator ):
87
113
csl = [{
88
114
'id' : 'example-id' ,
You can’t perform that action at this time.
0 commit comments