/usr/lib/python3/dist-packages/twisted/python/test
NameSizeModeActions
__pycache__/-0755rm
deprecatedattributes.py5710644editdlrm
modules_helpers.py16050644editdlrm
pullpipe.py12200644editdlrm
test_appdirs.py10810644editdlrm
test_components.py259740644editdlrm
test_constants.py381170644editdlrm
test_deprecate.py389300644editdlrm
test_dist3.py18580644editdlrm
test_fakepwd.py141070644editdlrm
test_htmlizer.py12660644editdlrm
test_inotify.py36390644editdlrm
test_release.py410460644editdlrm
test_runtime.py79260644editdlrm
test_sendmsg.py252330644editdlrm
test_setup.py124130644editdlrm
test_shellcomp.py218090644editdlrm
test_syslog.py49480644editdlrm
test_systemd.py64010644editdlrm
test_textattributes.py7120644editdlrm
test_tzhelper.py39840644editdlrm
test_url.py299280644editdlrm
test_urlpath.py103280644editdlrm
test_util.py364600644editdlrm
test_versions.py54000644editdlrm
test_zippath.py34740644editdlrm
test_zipstream.py123080644editdlrm
_deprecatetests.py.3only18140644editdlrm
__init__.py420644editdlrm
Edit: /usr/lib/python3/dist-packages/twisted/python/test/pullpipe.py (1220B)
# -*- test-case-name: twisted.python.test.test_sendmsg -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. import sys import os import socket from struct import unpack from twisted.python.sendmsg import recvmsg def recvfd(socketfd): """ Receive a file descriptor from a L{sendmsg} message on the given C{AF_UNIX} socket. @param socketfd: An C{AF_UNIX} socket, attached to another process waiting to send sockets via the ancillary data mechanism in L{send1msg}. @param fd: C{int} @return: a 2-tuple of (new file descriptor, description). @rtype: 2-tuple of (C{int}, C{bytes}) """ ourSocket = socket.fromfd(socketfd, socket.AF_UNIX, socket.SOCK_STREAM) data, ancillary, flags = recvmsg(ourSocket) [(cmsgLevel, cmsgType, packedFD)] = ancillary # cmsgLevel and cmsgType really need to be SOL_SOCKET / SCM_RIGHTS, but # since those are the *only* standard values, there's not much point in # checking. [unpackedFD] = unpack("i", packedFD) return (unpackedFD, data) if __name__ == '__main__': fd, description = recvfd(int(sys.argv[1])) os.write(fd, b"Test fixture data: " + description + b".\n") os.close(fd)