| 45 | self.assertTrue("a=1&b=2&c=heloo" in r.text()) |
| 46 | |
| 47 | def test_json(self): |
| 48 | raw = ''' |
| 49 | POST /post HTTP/1.1 |
| 50 | Host: httpbin.org |
| 51 | Connection: keep-alive |
| 52 | Upgrade-Insecure-Requests: 1 |
| 53 | User-Agent: celebrate hack-requests 1.0 ! |
| 54 | Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8 |
| 55 | Accept-Encoding: gzip, deflate |
| 56 | Accept-Language: zh-CN,zh;q=0.9,en;q=0.8 |
| 57 | Cookie: _gauges_unique_hour=1; _gauges_unique_day=1; _gauges_unique_month=1; _gauges_unique_year=1; _gauges_unique=1 |
| 58 | |
| 59 | {"hack-requests":"v1.0","author":"w8ay"} |
| 60 | ''' |
| 61 | r = self.hack.httpraw(raw) |
| 62 | self.assertTrue(json.loads(r.text())["json"] == {"author": "w8ay", "hack-requests": "v1.0"}) |
| 63 | |
| 64 | def test_chunked(self): |
| 65 | raw = ''' |