Skip to content

Commit

Permalink
Merge pull request #302 from NASA-PDS/classes_tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdunnjpl authored Jul 24, 2024
2 parents f40fd62 + a7117e9 commit 8804267
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ repos:
- id: trailing-whitespace
exclude: REQUIREMENTS\.md$
- id: end-of-file-fixer
exclude: REQUIREMENTS\.md$
exclude: REQUIREMENTS\.md$|postman_collection\.json$
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: debug-statements
Expand Down
97 changes: 97 additions & 0 deletions docker/postman/postman_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -2623,6 +2623,103 @@
}
},
"response": []
},
{
"name": "NASA-PDS/registry-api#461 classes basic behaviour",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"4438495 Status code is 200\", () => {pm.response.to.have.status(200)});",
"const content = pm.response.json();",
"",
"pm.test(\"4438495 Correct content count returned\", () => { pm.expect(content.length).to.eql(35) });"
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{baseUrl}}/classes",
"host": [
"{{baseUrl}}"
],
"path": [
"classes"
]
}
},
"response": []
},
{
"name": "NASA-PDS/registry-api#511 classes/{class} basic behaviour",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"C4438483 Status code is 200\", () => {pm.response.to.have.status(200)});",
"const content = pm.response.json();",
"pm.test(\"C4438483 only bundles returned\", () => {pm.expect(content.data.every(hit => hit.properties[\"pds:Identification_Area.pds:product_class\"][0] === \"Product_Bundle\")).to.be.true})"
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{baseUrl}}/classes/bundle",
"host": [
"{{baseUrl}}"
],
"path": [
"classes",
"bundle"
]
}
},
"response": []
},
{
"name": "NASA-PDS/registry-api#488 classes/{class} default to latest-only",
"event": [
{
"listen": "test",
"script": {
"exec": [
"const content = pm.response.json();",
"const relevantHits = content.data.filter(hit => hit.properties.lid[0] === \"urn:nasa:pds:mars2020.spice\")",
"pm.test(\"C4438484 Correct hits returned\", () => { pm.expect(relevantHits.length).to.eql(1) }); // will be 3 if not only latest",
"pm.test(\"C4438484 Correct data returned\", () => {pm.expect(relevantHits[0].id).to.eql(\"urn:nasa:pds:mars2020.spice::3.0\")});"
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{baseUrl}}/classes/bundle",
"host": [
"{{baseUrl}}"
],
"path": [
"classes",
"bundle"
]
}
},
"response": []
}
]
},
Expand Down

0 comments on commit 8804267

Please sign in to comment.