|
552 | 552 | } |
553 | 553 | ] |
554 | 554 | }, |
| 555 | + { |
| 556 | + "name": "20 – Image generation (demo mode)", |
| 557 | + "request": { |
| 558 | + "method": "POST", |
| 559 | + "header": [ |
| 560 | + { "key": "Content-Type", "value": "application/json" } |
| 561 | + ], |
| 562 | + "body": { |
| 563 | + "mode": "raw", |
| 564 | + "raw": "{\n \"response\": \"import matplotlib.pyplot as plt\\nplt.plot([1, 2, 3], [1, 4, 9])\\nplt.title('squares')\\n\",\n \"answer\": \"\",\n \"params\": {\n \"tests\": []\n }\n}", |
| 565 | + "options": { "raw": { "language": "json" } } |
| 566 | + }, |
| 567 | + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } |
| 568 | + }, |
| 569 | + "event": [ |
| 570 | + { |
| 571 | + "listen": "prerequest", |
| 572 | + "script": { |
| 573 | + "type": "text/javascript", |
| 574 | + "exec": ["pm.request.timeout = 40000;"] |
| 575 | + } |
| 576 | + }, |
| 577 | + { |
| 578 | + "listen": "test", |
| 579 | + "script": { |
| 580 | + "type": "text/javascript", |
| 581 | + "exec": [ |
| 582 | + "pm.test('Status 200', () => {", |
| 583 | + " pm.expect(pm.response.code, 'Body: ' + pm.response.text()).to.equal(200);", |
| 584 | + "});", |
| 585 | + "", |
| 586 | + "pm.test('Response is eval command with no error', () => {", |
| 587 | + " const json = pm.response.json();", |
| 588 | + " pm.expect(json.command).to.equal('eval');", |
| 589 | + " pm.expect(json).to.not.have.property('error');", |
| 590 | + "});", |
| 591 | + "", |
| 592 | + "pm.test('Feedback contains Output block (code ran successfully)', () => {", |
| 593 | + " pm.expect(pm.response.json().result.feedback).to.include('Output');", |
| 594 | + "});", |
| 595 | + "", |
| 596 | + "pm.test('Feedback contains uploaded plot link (requires cloud credentials)', () => {", |
| 597 | + " // This assertion only passes when the server has valid S3/image-upload", |
| 598 | + " // credentials. Skip or ignore locally if upload is not configured.", |
| 599 | + " const feedback = pm.response.json().result.feedback;", |
| 600 | + " pm.expect(feedback).to.include('![Plot 1]');", |
| 601 | + "});" |
| 602 | + ] |
| 603 | + } |
| 604 | + } |
| 605 | + ] |
| 606 | + }, |
555 | 607 | { |
556 | 608 | "name": "11 – numpy scientific library", |
557 | 609 | "request": { |
|
0 commit comments