Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add new tests for Q param on all end-points #313

Merged
merged 1 commit into from
Aug 21, 2024
Merged
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
102 changes: 93 additions & 9 deletions docker/postman/postman_collection.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"info": {
"info": {
"_postman_id": "6ee727e9-b4e3-4a72-8181-abd7d2d312e5",
"name": "Planetary Data System API Reference Tests Copy 9",
"description": "Federated PDS API which provides actionable end points standardized\nbetween the different nodes.\n\n\nContact Support:\n Email: [email protected]",
Expand Down Expand Up @@ -954,6 +954,56 @@
},
"response": []
},
{
"name": "NASA-PDS/registry-api#493 querystring supports NOT on other endpoint",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"C4443889 Status code is 200\", () => {",
" pm.response.to.have.status(200);",
"});",
"",
"var data = pm.response.json().data;",
"",
"pm.test(\"C4443889 Number of results is 1\", () => {",
" pm.expect(data.length).to.equal(1); ",
"});",
"",
"pm.test(\"C4443889 Returned hits contain correct values\", () => {",
" pm.expect(data[0][\"properties\"][\"product_class\"][0]).to.eql(\"Product_Bundle\");",
" pm.expect(data[0][\"properties\"][\"lid\"][0]).to.eql(\"urn:nasa:pds:insight_rad\"); ",
"});",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{baseUrl}}/classes/bundle?q=((product_class EQ \"Product_Bundle\") AND NOT (lid EQ \"urn:nasa:pds:mars2020.spice\"))",
"host": [
"{{baseUrl}}"
],
"path": [
"classes",
"bundle"
],
"query": [
{
"key": "q",
"value": "((product_class EQ \"Product_Bundle\") AND NOT (lid EQ \"urn:nasa:pds:mars2020.spice\"))"
}
]
}
},
"response": []
},
{
"name": "NASA-PDS/registry-api#495 querystring supports lowercase operators",
"event": [
Expand Down Expand Up @@ -2314,7 +2364,10 @@
"pm.test(\"C4438463 Status code is 200\", () => {pm.response.to.have.status(200)});",
"const content = pm.response.json();",
"pm.test(\"C4438463 Correct hits returned\", () => {pm.expect(content.summary.hits).to.eql(1)});",
"pm.test(\"C4438463 Correct data returned\", () => {pm.expect(content.data[0].id).to.eql(\"urn:nasa:pds:mars2020.spice:spice_kernels::3.0\")});"
"pm.test(\"C4438463 Correct data returned\", () => {pm.expect(content.data[0].id).to.eql(\"urn:nasa:pds:mars2020.spice:spice_kernels::3.0\")});",
"",
"pm.test(\"C4443905 Data match the q param\", () => {pm.expect(content.data[0]['properties'][\"pds:Collection.pds:collection_type\"][0]).to.eql(\"SPICE Kernel\")});",
""
],
"type": "text/javascript",
"packages": {}
Expand All @@ -2325,14 +2378,20 @@
"method": "GET",
"header": [],
"url": {
"raw": "{{baseUrl}}/products/urn:nasa:pds:mars2020.spice/members",
"raw": "{{baseUrl}}/products/urn:nasa:pds:mars2020.spice/members?q=pds:Collection.pds:collection_type eq \"SPICE Kernel\"",
"host": [
"{{baseUrl}}"
],
"path": [
"products",
"urn:nasa:pds:mars2020.spice",
"members"
],
"query": [
{
"key": "q",
"value": "pds:Collection.pds:collection_type eq \"SPICE Kernel\""
}
]
}
},
Expand Down Expand Up @@ -2382,7 +2441,10 @@
"exec": [
"pm.test(\"C4438464 Status code is 200\", () => {pm.response.to.have.status(200)});",
"const content = pm.response.json();",
"pm.test(\"C4438464 Correct hits returned\", () => {pm.expect(content.summary.hits).to.eql(11)});"
"pm.test(\"C4438464 Correct hits returned\", () => {pm.expect(content.summary.hits).to.eql(5)});",
"",
"pm.test(\"C4443902 data match q param\", () => {pm.expect(content.data[0][\"properties\"][\"pds:Time_Coordinates.pds:start_date_time\"][0]).to.eql(\"2020-07-30T12:51:34Z\")});",
""
],
"type": "text/javascript",
"packages": {}
Expand All @@ -2393,7 +2455,7 @@
"method": "GET",
"header": [],
"url": {
"raw": "{{baseUrl}}/products/urn:nasa:pds:mars2020.spice/members/members",
"raw": "{{baseUrl}}/products/urn:nasa:pds:mars2020.spice/members/members?q=pds:Time_Coordinates.pds:start_date_time eq \"2020-07-30T12:51:34Z\"",
"host": [
"{{baseUrl}}"
],
Expand All @@ -2402,6 +2464,12 @@
"urn:nasa:pds:mars2020.spice",
"members",
"members"
],
"query": [
{
"key": "q",
"value": "pds:Time_Coordinates.pds:start_date_time eq \"2020-07-30T12:51:34Z\""
}
]
}
},
Expand Down Expand Up @@ -2454,7 +2522,9 @@
"pm.test(\"C4438465 Status code is 200\", () => {pm.response.to.have.status(200)});",
"const content = pm.response.json();",
"pm.test(\"C4438465 Correct hits returned\", () => {pm.expect(content.summary.hits).to.eql(1)});",
"pm.test(\"C4438465 Correct data returned\", () => {pm.expect(content.data[0].id).to.eql(\"urn:nasa:pds:mars2020.spice:spice_kernels::3.0\")});"
"pm.test(\"C4438465 Correct data returned\", () => {pm.expect(content.data[0].id).to.eql(\"urn:nasa:pds:mars2020.spice:spice_kernels::3.0\")});",
"pm.test(\"C4443891 data match q param\", () => {pm.expect(content.data[0][\"properties\"][\"pds:Time_Coordinates.pds:start_date_time\"][0]).to.eql(\"2020-07-30T12:51:34Z\")});",
""
],
"type": "text/javascript",
"packages": {}
Expand All @@ -2465,14 +2535,20 @@
"method": "GET",
"header": [],
"url": {
"raw": "{{baseUrl}}/products/urn:nasa:pds:mars2020.spice:spice_kernels:mk_m2020/member-of",
"raw": "{{baseUrl}}/products/urn:nasa:pds:mars2020.spice:spice_kernels:mk_m2020/member-of?q=pds:Time_Coordinates.pds:start_date_time eq \"2020-07-30T12:51:34Z\"",
"host": [
"{{baseUrl}}"
],
"path": [
"products",
"urn:nasa:pds:mars2020.spice:spice_kernels:mk_m2020",
"member-of"
],
"query": [
{
"key": "q",
"value": "pds:Time_Coordinates.pds:start_date_time eq \"2020-07-30T12:51:34Z\""
}
]
}
},
Expand Down Expand Up @@ -2523,7 +2599,9 @@
"pm.test(\"C4438466 Status code is 200\", () => {pm.response.to.have.status(200)});",
"const content = pm.response.json();",
"pm.test(\"C4438466 Correct hits returned\", () => {pm.expect(content.summary.hits).to.eql(1)});",
"pm.test(\"C4438466 Correct data returned\", () => {pm.expect(content.data[0].id).to.eql(\"urn:nasa:pds:mars2020.spice::3.0\")});"
"pm.test(\"C4438466 Correct data returned\", () => {pm.expect(content.data[0].id).to.eql(\"urn:nasa:pds:mars2020.spice::3.0\")});",
"",
"pm.test(\"C4443890 Correct data returned according to q param\", () => {pm.expect(content.data[0][\"properties\"][\"pds:Time_Coordinates.pds:start_date_time\"][0]).to.eql(\"2020-07-30T12:51:34Z\")});"
],
"type": "text/javascript",
"packages": {}
Expand All @@ -2534,7 +2612,7 @@
"method": "GET",
"header": [],
"url": {
"raw": "{{baseUrl}}/products/urn:nasa:pds:mars2020.spice:spice_kernels:mk_m2020/member-of/member-of",
"raw": "{{baseUrl}}/products/urn:nasa:pds:mars2020.spice:spice_kernels:mk_m2020/member-of/member-of?q=pds:Time_Coordinates.pds:start_date_time eq \"2020-07-30T12:51:34Z\"",
"host": [
"{{baseUrl}}"
],
Expand All @@ -2543,6 +2621,12 @@
"urn:nasa:pds:mars2020.spice:spice_kernels:mk_m2020",
"member-of",
"member-of"
],
"query": [
{
"key": "q",
"value": "pds:Time_Coordinates.pds:start_date_time eq \"2020-07-30T12:51:34Z\""
}
]
}
},
Expand Down