mit neuen venv und exe-Files

This commit is contained in:
2024-11-03 17:26:54 +01:00
parent 07c05a338a
commit 0c373ff593
15115 changed files with 1998469 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
from gevent import monkey; monkey.patch_all()
import socket
import unittest
class TestSocketpair(unittest.TestCase):
def test_makefile(self):
msg = b'hello world'
x, y = socket.socketpair()
x.sendall(msg)
x.close()
with y.makefile('rb') as f:
read = f.read()
self.assertEqual(msg, read)
y.close()
@unittest.skipUnless(hasattr(socket, 'fromfd'),
'Needs socket.fromfd')
def test_fromfd(self):
msg = b'hello world'
x, y = socket.socketpair()
xx = socket.fromfd(x.fileno(), x.family, socket.SOCK_STREAM)
x.close()
yy = socket.fromfd(y.fileno(), y.family, socket.SOCK_STREAM)
y.close()
xx.sendall(msg)
xx.close()
with yy.makefile('rb') as f:
read = f.read()
self.assertEqual(msg, read)
yy.close()
if __name__ == '__main__':
unittest.main()