Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,24 @@ func TestInvalidTestcasesV0(t *testing.T) {
ValidationError{"monochromeLogo", "no such file: " + cwd + "/testdata/v0/invalid/no_such_file.png", 18, 1},
},

// organisation
"organisation_wrong_uri.yml": ValidationResults{
ValidationError{"organisation.uri", "uri is not a valid URI", 19, 3},
},
"organisation_wrong_type.yml": ValidationResults{
ValidationError{"organisation.name", "wrong type for this field", 18, 1},
ValidationError{"organisation.name", "name is a required field", 18, 3},
},
"organisation_name_missing.yml": ValidationResults{
ValidationError{"organisation.name", "name is a required field", 17, 3},
},
"organisation_uri_wrong_italian_pa.yml": ValidationResults{
ValidationError{"organisation.uri", "uri is not a valid URI", 20, 3},
},
"organisation_uri_wrong_italian_pa2.yml": ValidationResults{
ValidationError{"organisation.uri", "uri must be a valid Italian Public Administration Code (iPA) with format 'urn:x-italian-pa:[codiceIPA]' (see https://www.indicepa.gov.it/public-services/opendata-read-service.php?dstype=FS&filename=amministrazioni.txt)", 19, 3},
},

// inputTypes
"inputTypes_invalid.yml": ValidationResults{
ValidationError{"inputTypes[1]", "inputTypes[1] is not a valid MIME type", 1, 1},
Expand Down
55 changes: 55 additions & 0 deletions testdata/v0/invalid/organisation_name_missing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
publiccodeYmlVersion: "0.4"

name: Medusa
url: "https://github.com/italia/developers.italia.it.git"

platforms:
- web

categories:
- cloud-management

developmentStatus: development

softwareType: "standalone/other"

organisation:
uri: "https://example.org"
# Should NOT validate: name is missing
# name: foobar

description:
en-GB:
localisedName: Medusa
shortDescription: >
A rather short description which
is probably useless
longDescription: >
Very long description of this software, also split
on multiple rows. You should note what the software
is and why one should need it. This is 158 characters.
Very long description of this software, also split
on multiple rows. You should note what the software
is and why one should need it. This is 316 characters.
Very long description of this software, also split
on multiple rows. You should note what the software
is and why one should need it. This is 474 characters.
Very long description of this software, also split
on multiple rows. You should note what the software
is and why one should need it. This is 632 characters.
features:
- Just one feature

legal:
license: AGPL-3.0-or-later

maintenance:
type: "community"

contacts:
- name: Francesco Rossi

localisation:
localisationReady: true
availableLanguages:
- en
56 changes: 56 additions & 0 deletions testdata/v0/invalid/organisation_uri_wrong_italian_pa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
publiccodeYmlVersion: "0.4"

name: Medusa
url: "https://github.com/italia/developers.italia.it.git"

platforms:
- web

categories:
- cloud-management

developmentStatus: development

softwareType: "standalone/other"

organisation:
name: foobar
# Should NOT validate: uri is a literal Italian CodiceIPA,
# but should be in the format urn:x-italian-pa:[codiceIPA]
uri: pcm

description:
en-GB:
localisedName: Medusa
shortDescription: >
A rather short description which
is probably useless
longDescription: >
Very long description of this software, also split
on multiple rows. You should note what the software
is and why one should need it. This is 158 characters.
Very long description of this software, also split
on multiple rows. You should note what the software
is and why one should need it. This is 316 characters.
Very long description of this software, also split
on multiple rows. You should note what the software
is and why one should need it. This is 474 characters.
Very long description of this software, also split
on multiple rows. You should note what the software
is and why one should need it. This is 632 characters.
features:
- Just one feature

legal:
license: AGPL-3.0-or-later

maintenance:
type: "community"

contacts:
- name: Francesco Rossi

localisation:
localisationReady: true
availableLanguages:
- en
55 changes: 55 additions & 0 deletions testdata/v0/invalid/organisation_uri_wrong_italian_pa2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
publiccodeYmlVersion: "0.4"

name: Medusa
url: "https://github.com/italia/developers.italia.it.git"

platforms:
- web

categories:
- cloud-management

developmentStatus: development

softwareType: "standalone/other"

organisation:
name: foobar
# Should NOT validate: invalid Italian PA,
uri: urn:x-italian-pa:no_such_pa

description:
en-GB:
localisedName: Medusa
shortDescription: >
A rather short description which
is probably useless
longDescription: >
Very long description of this software, also split
on multiple rows. You should note what the software
is and why one should need it. This is 158 characters.
Very long description of this software, also split
on multiple rows. You should note what the software
is and why one should need it. This is 316 characters.
Very long description of this software, also split
on multiple rows. You should note what the software
is and why one should need it. This is 474 characters.
Very long description of this software, also split
on multiple rows. You should note what the software
is and why one should need it. This is 632 characters.
features:
- Just one feature

legal:
license: AGPL-3.0-or-later

maintenance:
type: "community"

contacts:
- name: Francesco Rossi

localisation:
localisationReady: true
availableLanguages:
- en
55 changes: 55 additions & 0 deletions testdata/v0/invalid/organisation_wrong_type.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
publiccodeYmlVersion: "0.4"

name: Medusa
url: "https://github.com/italia/developers.italia.it.git"

platforms:
- web

categories:
- cloud-management

developmentStatus: development

softwareType: "standalone/other"

organisation:
# Should NOT validate: organisation has to be an object, not a list
- name: foobar
uri: "urn:foo:bar"

description:
en-GB:
localisedName: Medusa
shortDescription: >
A rather short description which
is probably useless
longDescription: >
Very long description of this software, also split
on multiple rows. You should note what the software
is and why one should need it. This is 158 characters.
Very long description of this software, also split
on multiple rows. You should note what the software
is and why one should need it. This is 316 characters.
Very long description of this software, also split
on multiple rows. You should note what the software
is and why one should need it. This is 474 characters.
Very long description of this software, also split
on multiple rows. You should note what the software
is and why one should need it. This is 632 characters.
features:
- Just one feature

legal:
license: AGPL-3.0-or-later

maintenance:
type: "community"

contacts:
- name: Francesco Rossi

localisation:
localisationReady: true
availableLanguages:
- en
55 changes: 55 additions & 0 deletions testdata/v0/invalid/organisation_wrong_uri.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
publiccodeYmlVersion: "0.4"

name: Medusa
url: "https://github.com/italia/developers.italia.it.git"

platforms:
- web

categories:
- cloud-management

developmentStatus: development

softwareType: "standalone/other"

organisation:
name: foobar
# Should NOT validate: uri is an invalid URI
uri: "1"

description:
en-GB:
localisedName: Medusa
shortDescription: >
A rather short description which
is probably useless
longDescription: >
Very long description of this software, also split
on multiple rows. You should note what the software
is and why one should need it. This is 158 characters.
Very long description of this software, also split
on multiple rows. You should note what the software
is and why one should need it. This is 316 characters.
Very long description of this software, also split
on multiple rows. You should note what the software
is and why one should need it. This is 474 characters.
Very long description of this software, also split
on multiple rows. You should note what the software
is and why one should need it. This is 632 characters.
features:
- Just one feature

legal:
license: AGPL-3.0-or-later

maintenance:
type: "community"

contacts:
- name: Francesco Rossi

localisation:
localisationReady: true
availableLanguages:
- en
53 changes: 53 additions & 0 deletions testdata/v0/valid/valid_with_organisation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
publiccodeYmlVersion: "0.4"

name: Medusa
url: "https://github.com/italia/developers.italia.it.git"

platforms:
- web

categories:
- cloud-management

developmentStatus: development

softwareType: "standalone/other"

organisation:
name: foobar

description:
en-GB:
localisedName: Medusa
shortDescription: >
A rather short description which
is probably useless
longDescription: >
Very long description of this software, also split
on multiple rows. You should note what the software
is and why one should need it. This is 158 characters.
Very long description of this software, also split
on multiple rows. You should note what the software
is and why one should need it. This is 316 characters.
Very long description of this software, also split
on multiple rows. You should note what the software
is and why one should need it. This is 474 characters.
Very long description of this software, also split
on multiple rows. You should note what the software
is and why one should need it. This is 632 characters.
features:
- Just one feature

legal:
license: AGPL-3.0-or-later

maintenance:
type: "community"

contacts:
- name: Francesco Rossi

localisation:
localisationReady: true
availableLanguages:
- en
Loading