Skip to content

Commit 7bac07f

Browse files
committed
Working on Speleothem tests
The Speleothem endpoint was added, but needed some minor tweaks to make it pass the tests. First, I added a new 'collectionunitidPath` to the openapi parameters. This allows us to test the endpoint properly. To support collectionunitids or other parameters elsewhere, I used the `paramgrab` model in the speleothems.js file, along with `ifUndef()`. This then captures the parameter in the path and passes it along cleanly to the query. The function seems to resolve now.
1 parent 5b8206f commit 7bac07f

40 files changed

+4415
-4387
lines changed

openapi.yaml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,21 @@ components:
180180
format: int64
181181
type: integer
182182
minimum: 0
183+
maximum: 70000
184+
exclusiveMinimum: true
185+
collectionunitidPath:
186+
description: >-
187+
A valid collection unit identifer from the Neotoma database. This is the internal identifier within the
188+
[`ndb.collectionunits`](https://open.neotomadb.org/dbschema/ndb/tables/collectionunits.html) table. If the
189+
collection unit ID contains no speleothem data, then the result will be an empty dataset.
190+
in: path
191+
name: collectionunitid
192+
required: true
193+
schema:
194+
format: int64
195+
type: integer
196+
minimum: 0
197+
maximum: 70000
183198
exclusiveMinimum: true
184199
chronidPath:
185200
description: >-
@@ -3159,7 +3174,7 @@ paths:
31593174
get:
31603175
description: Returns information about speleothem specific metadata given a collectionunit ID.
31613176
parameters:
3162-
- $ref: '#/components/parameters/collectionunitidQuery'
3177+
- $ref: '#/components/parameters/collectionunitidPath'
31633178
responses:
31643179
'200':
31653180
content:

openapi/components/parameters/parameters.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,20 @@ collectionunitidQuery:
130130
format: int64
131131
type: integer
132132
minimum: 0
133+
maximum: 70000
134+
exclusiveMinimum: true
135+
collectionunitidPath:
136+
description: A valid collection unit identifer from the Neotoma database. This is the internal identifier within the
137+
[`ndb.collectionunits`](https://open.neotomadb.org/dbschema/ndb/tables/collectionunits.html) table. If the collection unit ID contains no
138+
speleothem data, then the result will be an empty dataset.
139+
in: path
140+
name: collectionunitid
141+
required: true
142+
schema:
143+
format: int64
144+
type: integer
145+
minimum: 0
146+
maximum: 70000
133147
exclusiveMinimum: true
134148
chronidPath:
135149
description: Unique chronology identifier. This is the internal identifier within the [`ndb.chronologies`](https://open.neotomadb.org/dbschema/ndb/tables/chronologies.html) table. Note that although the chronology IDs are generated sequentially, not all chronology IDs are currently in use.

openapi/paths/v20/data.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@
187187
get:
188188
description: Returns information about speleothem specific metadata given a collectionunit ID.
189189
parameters:
190-
- $ref: '#/components/parameters/collectionunitidQuery'
190+
- $ref: '#/components/parameters/collectionunitidPath'
191191
responses:
192192
'200':
193193
content:

public/tests.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

public/tests.json

Lines changed: 4331 additions & 4331 deletions
Large diffs are not rendered by default.

test/v1.5-data-contacts-{contactid}-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const expect = chakram.expect;
77
describe('tests for /v1.5/data/contacts/{contactid}', function() {
88
describe('tests for get', function() {
99
it('should respond 200 for "Contact"', function() {
10-
const response = request('get', 'http://localhost:3001/v1.5/data/contacts/500', {
10+
const response = request('get', 'http://localhost:3001/v1.5/data/contacts/-44938686', {
1111
'time': true,
1212
});
1313

test/v1.5-data-geopoliticalunits-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ describe('tests for /v1.5/data/geopoliticalunits', function() {
88
describe('tests for get', function() {
99
it('should respond 200 for "An array of geopolitical units."', function() {
1010
const response = request('get', 'http://localhost:3001/v1.5/data/geopoliticalunits', {
11-
'qs': {'gpid': 5392, 'gpname': 'Canada', 'rank': 2, 'lower': false},
11+
'qs': {'gpid': 5392, 'gpname': 'Canada', 'rank': 4, 'lower': true},
1212
'time': true,
1313
});
1414

test/v1.5-data-geopoliticalunits-{gpid}-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const expect = chakram.expect;
77
describe('tests for /v1.5/data/geopoliticalunits/{gpid}', function() {
88
describe('tests for get', function() {
99
it('should respond 200 for "An array of geopolitical units."', function() {
10-
const response = request('get', 'http://localhost:3001/v1.5/data/geopoliticalunits/500', {
10+
const response = request('get', 'http://localhost:3001/v1.5/data/geopoliticalunits/6244', {
1111
'time': true,
1212
});
1313

test/v2.0-apps-constdb-datasetages-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ describe('tests for /v2.0/apps/constdb/datasetages', function() {
88
describe('tests for get', function() {
99
it('should respond 200 for "Returns an ordered array (from earliest to latest) of upload counts by month (YYYY/MM/DD; all days as 01). Months with no uploads are excluded. "', function() {
1010
const response = request('get', 'http://localhost:3001/v2.0/apps/constdb/datasetages', {
11-
'qs': {'dbid': 3},
11+
'qs': {'dbid': 14},
1212
'time': true,
1313
});
1414

test/v2.0-apps-constdb-datasets-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ describe('tests for /v2.0/apps/constdb/datasets', function() {
88
describe('tests for get', function() {
99
it('should respond 200 for "Returns the set of datasets contained within a constituent database, identified by the constituent database identifier. Used for quick landing page generation. "', function() {
1010
const response = request('get', 'http://localhost:3001/v2.0/apps/constdb/datasets', {
11-
'qs': {'dbid': 27},
11+
'qs': {'dbid': 9},
1212
'time': true,
1313
});
1414

0 commit comments

Comments
 (0)