diff --git a/src/commands/get-odr-base-url/__test__/get-odr-base-url.test.ts b/src/commands/get-odr-base-url/__test__/get-odr-base-url.test.ts index a9cb61935..6aaac316d 100644 --- a/src/commands/get-odr-base-url/__test__/get-odr-base-url.test.ts +++ b/src/commands/get-odr-base-url/__test__/get-odr-base-url.test.ts @@ -3,23 +3,25 @@ import { describe, it } from 'node:test'; import { CollectionProps, crses, imageryProducts, regions } from '../get-odr-base-url.js'; -describe('getOdrBaseUrl', () => { +const methodName = 'getOdrBaseUrl'; + +describe(methodName, () => { it('should throw if the bucket is unknown', () => { assert.throws(() => { - anyCollectionProps().getOdrBaseUrl(new URL('s3://example-bucket/')); + anyCollectionProps()[methodName](new URL('s3://example-bucket/')); }, Error('bucket not in bucket list: example-bucket')); }); it('should return base URL for imagery surveys', () => { const collectionProps = new CollectionProps('canterbury', 'timaru', 2022, 2023, '0.01m', 'rgb', 2193); assert.equal( - collectionProps.getOdrBaseUrl(new URL('s3://nz-imagery/')), + collectionProps[methodName](new URL('s3://nz-imagery/')), 's3://nz-imagery/canterbury/timaru_2022-2023_0.01m/rgb/2193/', ); }); it('should return base URL for digital elevation models', () => { const collectionProps = new CollectionProps('canterbury', 'kaikoura', 2012, 2012, '10m', 'dem', 2193); assert.equal( - collectionProps.getOdrBaseUrl(new URL('s3://linz-elevation/')), + collectionProps[methodName](new URL('s3://linz-elevation/')), 's3://linz-elevation/canterbury/kaikoura_2012/dem_10m/2193/', ); });