Skip to content

Commit 852c50f

Browse files
committed
test: cover IT country section rejection in publiccode.yml 1
v1 dropped the whole Italian country section, so IT and it are now unknown fields. Moved the conforme, riuso/codiceIPA and lowercase section fixtures into the invalid v1 set.
1 parent c4c0944 commit 852c50f

4 files changed

Lines changed: 12 additions & 2 deletions

File tree

testdata/v1/invalid_valid_with_warnings_in_v0/valid_with_IT_riuso_codiceIPA.yml renamed to testdata/v1/invalid/IT_riuso_codiceIPA.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ dependsOn:
114114
- name: NFC Reader
115115
optional: true
116116

117+
# Should NOT validate: the IT section was removed in v1
117118
IT:
118119
riuso:
119120
codiceIPA: pcm

testdata/v1/invalid_valid_with_warnings_in_v0/valid_with_country_specific_section_downcase.yml renamed to testdata/v1/invalid/country_specific_section_downcase.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ dependsOn:
103103
- name: NFC Reader2
104104
optional: true
105105

106-
# Should have a warning here, downcase is deprecated:
106+
# Should NOT validate: the it section was removed in v1
107107
it:
108108
countryExtensionVersion: "1.0"
109109

testdata/v1/invalid_valid_with_warnings_in_v0/valid_with_it_conforme.yml renamed to testdata/v1/invalid/it_conforme.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ dependsOn:
114114
- name: NFC Reader
115115
optional: true
116116

117+
# Should NOT validate: the IT section was removed in v1
117118
IT:
118-
# Should have warnings for IT.conforme, because it is deprecated
119119
conforme:
120120
lineeGuidaDesign: true
121121
modelloInteroperabilita: true

v1_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@ func TestInvalidTestcasesV1(t *testing.T) {
1818
"applicationSuite_wrong_type.yml": ValidationResults{
1919
ValidationError{"applicationSuite", "wrong type for this field", 4, 1},
2020
},
21+
"it_conforme.yml": ValidationResults{
22+
ValidationError{"IT", "unknown field \"IT\"", 118, 1},
23+
},
24+
"IT_riuso_codiceIPA.yml": ValidationResults{
25+
ValidationError{"IT", "unknown field \"IT\"", 118, 1},
26+
},
27+
"country_specific_section_downcase.yml": ValidationResults{
28+
ValidationError{"it", "unknown field \"it\"", 107, 1},
29+
},
2130
"categories_invalid.yml": ValidationResults{
2231
ValidationError{"categories[0]", "categories[0] must be a valid category (see https://github.com/publiccodeyml/publiccode.yml/blob/main/docs/standard/categories-list.rst)", 13, 5},
2332
},

0 commit comments

Comments
 (0)