(self)
| 6946 | pass |
| 6947 | |
| 6948 | def test_errors(self): |
| 6949 | with open(os_helper.TESTFN, 'rb') as file: |
| 6950 | with socket.socket(type=socket.SOCK_DGRAM) as s: |
| 6951 | meth = self.meth_from_sock(s) |
| 6952 | self.assertRaisesRegex( |
| 6953 | ValueError, "SOCK_STREAM", meth, file) |
| 6954 | with open(os_helper.TESTFN, encoding="utf-8") as file: |
| 6955 | with socket.socket() as s: |
| 6956 | meth = self.meth_from_sock(s) |
| 6957 | self.assertRaisesRegex( |
| 6958 | ValueError, "binary mode", meth, file) |
| 6959 | with open(os_helper.TESTFN, 'rb') as file: |
| 6960 | with socket.socket() as s: |
| 6961 | meth = self.meth_from_sock(s) |
| 6962 | self.assertRaisesRegex(TypeError, "positive integer", |
| 6963 | meth, file, count='2') |
| 6964 | self.assertRaisesRegex(TypeError, "positive integer", |
| 6965 | meth, file, count=0.1) |
| 6966 | self.assertRaisesRegex(ValueError, "positive integer", |
| 6967 | meth, file, count=0) |
| 6968 | self.assertRaisesRegex(ValueError, "positive integer", |
| 6969 | meth, file, count=-1) |
| 6970 | |
| 6971 | |
| 6972 | @unittest.skipUnless(hasattr(os, "sendfile"), |
nothing calls this directly
no test coverage detected