(self)
| 18 | } |
| 19 | |
| 20 | def test_data(self): |
| 21 | r1 = self.request_class(url="http://www.example.com/") |
| 22 | assert r1.body == b"" |
| 23 | |
| 24 | body = b"body" |
| 25 | r2 = self.request_class(url="http://www.example.com/", body=body) |
| 26 | assert r2.body == body |
| 27 | |
| 28 | data = { |
| 29 | "name": "value", |
| 30 | } |
| 31 | r3 = self.request_class(url="http://www.example.com/", data=data) |
| 32 | assert r3.body == to_bytes(json.dumps(data)) |
| 33 | |
| 34 | # empty data |
| 35 | r4 = self.request_class(url="http://www.example.com/", data=[]) |
| 36 | assert r4.body == to_bytes(json.dumps([])) |
| 37 | |
| 38 | def test_data_method(self): |
| 39 | # data is not passed |
nothing calls this directly
no test coverage detected