Skip to content

Commit f01b357

Browse files
committed
Fix schema and bitbucket tests
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
1 parent 4a6a643 commit f01b357

File tree

2 files changed

+12
-41
lines changed

2 files changed

+12
-41
lines changed

schemas/purl-test.schema.json

Lines changed: 3 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -337,48 +337,14 @@
337337
"title": "Expected validation messages and severities",
338338
"description": "List of validation objects with message and severity expected for this test. Can be an empty list.",
339339
"type": "array",
340-
"$ref": "#/definitions/purl_validation_message"
341-
}
342-
},
343-
"required": [
344-
"input",
345-
"expected_output"
346-
]
347-
}
348-
},
349-
{
350-
"if": {
351-
"properties": {
352-
"test_type": {
353-
"const": "validation"
354-
}
355-
},
356-
"required": [
357-
"test_type"
358-
]
359-
},
360-
"then": {
361-
"properties": {
362-
"input": {
363-
"title": "Expected decoded PURL components",
364-
"description": "Test input as an object with decoded PURL components for validation.",
365-
"$ref": "#/definitions/purl_components"
366-
},
367-
"expected_messages": {
368-
"title": "Expected messages",
369-
"description": "Validation messages expected for this test. Can be null or a list of strings.",
370-
"default": null,
371-
"type": [
372-
"null",
373-
"array"
374-
],
375340
"items": {
376-
"type": "string"
341+
"$ref": "#/definitions/purl_validation_message"
377342
}
378343
}
379344
},
380345
"required": [
381-
"input"
346+
"input",
347+
"expected_output"
382348
]
383349
}
384350
}

tests/types/bitbucket-test.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,28 +97,33 @@
9797
"test_group": "base",
9898
"test_type": "validation",
9999
"input": "pkg:bitbucket/birkenfeld/pygments-main@244fd47e07d1014f0aed9c",
100-
"expected_messages": null
100+
"expected_output": []
101101
},
102102
{
103103
"description": "Valid Bitbucket package with subpath",
104104
"test_group": "base",
105105
"test_type": "validation",
106106
"input": "pkg:bitbucket/teamname/repo-name@1.0.0#src/main",
107-
"expected_messages": null
107+
"expected_output": []
108108
},
109109
{
110110
"description": "Valid Bitbucket package with qualifiers",
111111
"test_group": "base",
112112
"test_type": "validation",
113113
"input": "pkg:bitbucket/company/service@release-2024?arch=x86_64&os=linux",
114-
"expected_messages": null
114+
"expected_output": [
115+
{
116+
"severity": "info",
117+
"message": "Invalid qualifiers found: arch, os. Allowed qualifiers are: repository_url"
118+
}
119+
]
115120
},
116121
{
117122
"description": "Valid Bitbucket package with qualifiers",
118123
"test_group": "advanced",
119124
"test_type": "validation",
120125
"input": "pkg:bitbucket/company/service@release-2024?arch=x86_64&os=linux",
121-
"expected_messages": null
126+
"expected_output": []
122127
}
123128
]
124129
}

0 commit comments

Comments
 (0)