def _saveConfiguredIDTest(self, argv, uid, gid): """ Test that when L{run} is invoked and L{sys.argv} has the given value, the resulting application has the specified UID and GID. @type argv: C{list} of C{str} @param argv: The value to which to set L{sys.argv} before calling L{run}. @type uid: C{int} @param uid: The expected value for the resulting application's L{IProcess.uid}. @type gid: C{int} @param gid: The expected value for the resulting application's L{IProcess.gid}. """ sys.argv = argv run() app = loadApplication("ftp.tap", "pickle", None) process = IProcess(app) self.assertEqual(process.uid, uid) self.assertEqual(process.gid, gid)
#!/AFDKOPythonBuild/bin/python2.7 # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. ### Twisted Preamble # This makes sure that users don't have to set up their environment # specially in order to run these programs from bin/. import sys, os, string if string.find(os.path.abspath(sys.argv[0]), os.sep+'Twisted') != -1: sys.path.insert(0, os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]), os.pardir, os.pardir))) if not hasattr(os, "getuid") or os.getuid() != 0: sys.path.insert(0, os.getcwd()) ### end of preamble from twisted.scripts.mktap import run run()
#!c:\python27\python.exe # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. ### Twisted Preamble # This makes sure that users don't have to set up their environment # specially in order to run these programs from bin/. import sys, os, string if string.find(os.path.abspath(sys.argv[0]), os.sep + 'Twisted') != -1: sys.path.insert( 0, os.path.normpath( os.path.join(os.path.abspath(sys.argv[0]), os.pardir, os.pardir))) if not hasattr(os, "getuid") or os.getuid() != 0: sys.path.insert(0, os.getcwd()) ### end of preamble from twisted.scripts.mktap import run run()