3
3
import Openlayer from 'openlayer' ;
4
4
import { Response } from 'node-fetch' ;
5
5
6
- const openlayer = new Openlayer ( {
6
+ const client = new Openlayer ( {
7
7
apiKey : 'My API Key' ,
8
8
baseURL : process . env [ 'TEST_API_BASE_URL' ] ?? 'http://127.0.0.1:4010' ,
9
9
} ) ;
10
10
11
11
describe ( 'resource inferencePipelines' , ( ) => {
12
12
test ( 'retrieve' , async ( ) => {
13
- const responsePromise = openlayer . inferencePipelines . retrieve ( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' ) ;
13
+ const responsePromise = client . inferencePipelines . retrieve ( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' ) ;
14
14
const rawResponse = await responsePromise . asResponse ( ) ;
15
15
expect ( rawResponse ) . toBeInstanceOf ( Response ) ;
16
16
const response = await responsePromise ;
@@ -23,14 +23,14 @@ describe('resource inferencePipelines', () => {
23
23
test ( 'retrieve: request options instead of params are passed correctly' , async ( ) => {
24
24
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
25
25
await expect (
26
- openlayer . inferencePipelines . retrieve ( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' , {
26
+ client . inferencePipelines . retrieve ( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' , {
27
27
path : '/_stainless_unknown_path' ,
28
28
} ) ,
29
29
) . rejects . toThrow ( Openlayer . NotFoundError ) ;
30
30
} ) ;
31
31
32
32
test ( 'update' , async ( ) => {
33
- const responsePromise = openlayer . inferencePipelines . update ( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' ) ;
33
+ const responsePromise = client . inferencePipelines . update ( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' ) ;
34
34
const rawResponse = await responsePromise . asResponse ( ) ;
35
35
expect ( rawResponse ) . toBeInstanceOf ( Response ) ;
36
36
const response = await responsePromise ;
@@ -43,7 +43,7 @@ describe('resource inferencePipelines', () => {
43
43
test ( 'update: request options instead of params are passed correctly' , async ( ) => {
44
44
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
45
45
await expect (
46
- openlayer . inferencePipelines . update ( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' , {
46
+ client . inferencePipelines . update ( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' , {
47
47
path : '/_stainless_unknown_path' ,
48
48
} ) ,
49
49
) . rejects . toThrow ( Openlayer . NotFoundError ) ;
@@ -52,7 +52,7 @@ describe('resource inferencePipelines', () => {
52
52
test ( 'update: request options and params are passed correctly' , async ( ) => {
53
53
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
54
54
await expect (
55
- openlayer . inferencePipelines . update (
55
+ client . inferencePipelines . update (
56
56
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' ,
57
57
{
58
58
description : 'This pipeline is used for production.' ,
@@ -65,7 +65,7 @@ describe('resource inferencePipelines', () => {
65
65
} ) ;
66
66
67
67
test ( 'delete' , async ( ) => {
68
- const responsePromise = openlayer . inferencePipelines . delete ( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' ) ;
68
+ const responsePromise = client . inferencePipelines . delete ( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' ) ;
69
69
const rawResponse = await responsePromise . asResponse ( ) ;
70
70
expect ( rawResponse ) . toBeInstanceOf ( Response ) ;
71
71
const response = await responsePromise ;
@@ -78,7 +78,7 @@ describe('resource inferencePipelines', () => {
78
78
test ( 'delete: request options instead of params are passed correctly' , async ( ) => {
79
79
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
80
80
await expect (
81
- openlayer . inferencePipelines . delete ( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' , {
81
+ client . inferencePipelines . delete ( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' , {
82
82
path : '/_stainless_unknown_path' ,
83
83
} ) ,
84
84
) . rejects . toThrow ( Openlayer . NotFoundError ) ;
0 commit comments