(self)
| 610 | self.assertFalse(loop.remove_writer.called) |
| 611 | |
| 612 | def test_static_handle_exception(self): |
| 613 | loop = mock.Mock() |
| 614 | route = self.router.add_static('/st', |
| 615 | os.path.dirname(aiohttp.__file__)) |
| 616 | with mock.patch('aiohttp.web_urldispatcher.os') as m_os: |
| 617 | out_fd = 30 |
| 618 | in_fd = 31 |
| 619 | fut = asyncio.Future(loop=self.loop) |
| 620 | exc = OSError() |
| 621 | m_os.sendfile.side_effect = exc |
| 622 | route._sendfile_cb(fut, out_fd, in_fd, 0, 100, loop, False) |
| 623 | m_os.sendfile.assert_called_with(out_fd, in_fd, 0, 100) |
| 624 | self.assertTrue(fut.done()) |
| 625 | self.assertIs(exc, fut.exception()) |
| 626 | self.assertFalse(loop.add_writer.called) |
| 627 | self.assertFalse(loop.remove_writer.called) |
| 628 | |
| 629 | def fill_routes(self): |
| 630 | route1 = self.router.add_route('GET', '/plain', self.make_handler()) |
nothing calls this directly
no test coverage detected