Skip to content

Commit 0bef455

Browse files
committed
fix tests
1 parent 9b271dd commit 0bef455

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Diff for: packages/react-openapi/src/code-samples.test.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ describe('python code sample generator', () => {
366366
const output = generator?.generate(input);
367367

368368
expect(output).toBe(
369-
'import requests\n\nresponse = requests.get(\n "https://example.com/path",\n headers={"Content-Type":"application/x-www-form-urlencoded"},\n data={"key":"value"}\n)\n\ndata = response.json()'
369+
'import requests\n\nresponse = requests.get(\n "https://example.com/path",\n headers={"Content-Type":"application/x-www-form-urlencoded"},\n json={"key":"value"}\n)\n\ndata = response.json()'
370370
);
371371
});
372372

@@ -385,7 +385,7 @@ describe('python code sample generator', () => {
385385
const output = generator?.generate(input);
386386

387387
expect(output).toBe(
388-
'import requests\n\nresponse = requests.get(\n "https://example.com/path",\n headers={"Content-Type":"application/json"},\n data={"key":"value"}\n)\n\ndata = response.json()'
388+
'import requests\n\nresponse = requests.get(\n "https://example.com/path",\n headers={"Content-Type":"application/json"},\n json={"key":"value"}\n)\n\ndata = response.json()'
389389
);
390390
});
391391

@@ -402,7 +402,7 @@ describe('python code sample generator', () => {
402402
const output = generator?.generate(input);
403403

404404
expect(output).toBe(
405-
'import requests\n\nresponse = requests.get(\n "https://example.com/path",\n headers={"Content-Type":"application/xml"},\n data="<key>value</key>"\n)\n\ndata = response.json()'
405+
'import requests\n\nresponse = requests.get(\n "https://example.com/path",\n headers={"Content-Type":"application/xml"},\n json="<key>value</key>"\n)\n\ndata = response.json()'
406406
);
407407
});
408408

@@ -419,7 +419,7 @@ describe('python code sample generator', () => {
419419
const output = generator?.generate(input);
420420

421421
expect(output).toBe(
422-
'import requests\n\nresponse = requests.get(\n "https://example.com/path",\n headers={"Content-Type":"application/graphql"},\n data="{ key }"\n)\n\ndata = response.json()'
422+
'import requests\n\nresponse = requests.get(\n "https://example.com/path",\n headers={"Content-Type":"application/graphql"},\n json="{ key }"\n)\n\ndata = response.json()'
423423
);
424424
});
425425

@@ -436,7 +436,7 @@ describe('python code sample generator', () => {
436436
const output = generator?.generate(input);
437437

438438
expect(output).toBe(
439-
'import requests\n\nresponse = requests.get(\n "https://example.com/path",\n headers={"Content-Type":"text/csv"},\n data="key,value"\n)\n\ndata = response.json()'
439+
'import requests\n\nresponse = requests.get(\n "https://example.com/path",\n headers={"Content-Type":"text/csv"},\n json="key,value"\n)\n\ndata = response.json()'
440440
);
441441
});
442442

@@ -470,7 +470,7 @@ describe('python code sample generator', () => {
470470
const output = generator?.generate(input);
471471

472472
expect(output).toBe(
473-
'import requests\n\nresponse = requests.get(\n "https://example.com/path",\n headers={"Content-Type":"text/plain"},\n data="value"\n)\n\ndata = response.json()'
473+
'import requests\n\nresponse = requests.get(\n "https://example.com/path",\n headers={"Content-Type":"text/plain"},\n json="value"\n)\n\ndata = response.json()'
474474
);
475475
});
476476

0 commit comments

Comments
 (0)