TRM-coding | d1cbf67 | 2025-06-18 15:15:08 +0800 | [diff] [blame] | 1 | import requests |
| 2 | url = 'http://127.0.0.1:5713/' |
| 3 | |
| 4 | def test_get_postlist(): |
| 5 | print() |
| 6 | urlx=url+'apostlist' |
| 7 | payload = { |
| 8 | 'userid': 3 |
| 9 | } |
| 10 | headers = {'Content-Type': 'application/json'} |
| 11 | |
| 12 | resp = requests.get(urlx, json=payload, headers=headers) |
| 13 | # print(resp.status_code) |
| 14 | print(resp.json()) |
| 15 | |
| 16 | def test_get_post(): |
| 17 | print() |
| 18 | urlx=url+'agetpost' |
| 19 | payload = { |
| 20 | 'userid': 3, |
| 21 | 'postid': 21 |
| 22 | } |
| 23 | headers = {'Content-Type': 'application/json'} |
| 24 | |
| 25 | resp = requests.get(urlx, json=payload, headers=headers) |
| 26 | # print(resp.status_code) |
| 27 | print(resp.json()) |
| 28 | |
| 29 | def test_review_post(): |
| 30 | print() |
| 31 | urlx=url+'areview' |
| 32 | payload = { |
| 33 | 'userid': 3, |
| 34 | 'postid': 21, |
| 35 | 'status': 'rejected' |
| 36 | } |
| 37 | headers = {'Content-Type': 'application/json'} |
| 38 | |
| 39 | resp = requests.get(urlx, json=payload, headers=headers) |
| 40 | # print(resp.status_code) |
| 41 | print(resp.json()) |