(self)
| 7049 | pass |
| 7050 | |
| 7051 | def test_errors(self): |
| 7052 | with open(os_helper.TESTFN, 'rb') as file: |
| 7053 | with socket.socket(type=socket.SOCK_DGRAM) as s: |
| 7054 | meth = self.meth_from_sock(s) |
| 7055 | self.assertRaisesRegex( |
| 7056 | ValueError, "SOCK_STREAM", meth, file) |
| 7057 | with open(os_helper.TESTFN, encoding="utf-8") as file: |
| 7058 | with socket.socket() as s: |
| 7059 | meth = self.meth_from_sock(s) |
| 7060 | self.assertRaisesRegex( |
| 7061 | ValueError, "binary mode", meth, file) |
| 7062 | with open(os_helper.TESTFN, 'rb') as file: |
| 7063 | with socket.socket() as s: |
| 7064 | meth = self.meth_from_sock(s) |
| 7065 | self.assertRaisesRegex(TypeError, "positive integer", |
| 7066 | meth, file, count='2') |
| 7067 | self.assertRaisesRegex(TypeError, "positive integer", |
| 7068 | meth, file, count=0.1) |
| 7069 | self.assertRaisesRegex(ValueError, "positive integer", |
| 7070 | meth, file, count=0) |
| 7071 | self.assertRaisesRegex(ValueError, "positive integer", |
| 7072 | meth, file, count=-1) |
| 7073 | |
| 7074 | |
| 7075 | @unittest.skipUnless(hasattr(os, "sendfile"), |
nothing calls this directly
no test coverage detected