| 13 | self.hack = HackRequests.hackRequests() |
| 14 | |
| 15 | def test_get(self): |
| 16 | raw = ''' |
| 17 | GET /get?a=1&b=2&c=heloo HTTP/1.1 |
| 18 | Host: httpbin.org |
| 19 | Connection: keep-alive |
| 20 | Upgrade-Insecure-Requests: 1 |
| 21 | User-Agent: celebrate hack-requests 1.0 ! |
| 22 | Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8 |
| 23 | Accept-Encoding: gzip, deflate |
| 24 | Accept-Language: zh-CN,zh;q=0.9,en;q=0.8 |
| 25 | Cookie: _gauges_unique_hour=1; _gauges_unique_day=1; _gauges_unique_month=1; _gauges_unique_year=1; _gauges_unique=1 |
| 26 | ''' |
| 27 | r = self.hack.httpraw(raw) |
| 28 | self.assertTrue(json.loads(r.text())["args"] == {"a": "1", "b": "2", "c": "heloo"}) |
| 29 | |
| 30 | def test_post(self): |
| 31 | raw = ''' |