(self)
| 1716 | |
| 1717 | class GetFileByUrl(BaseStdout): |
| 1718 | def test_basic(self): |
| 1719 | raw_resp_content = "hello, ".encode("ascii") + "world".encode("utf-8") |
| 1720 | resp_obj = requests.Response() |
| 1721 | resp_obj.__setstate__({"_content": raw_resp_content}) |
| 1722 | |
| 1723 | expected = "hello, world" |
| 1724 | |
| 1725 | with mock.patch("requests.get", return_value=resp_obj): |
| 1726 | actual = get_file_by_url("www.test-url.com") |
| 1727 | |
| 1728 | self.assertEqual(expected, actual) |
| 1729 | |
| 1730 | def test_with_idna(self): |
| 1731 | raw_resp_content = b"www.huala\xc3\xb1e.cl" |
nothing calls this directly
no test coverage detected