Apache/2.4.7 (Ubuntu) Linux sman1baleendah 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) safemode : OFF MySQL: ON | Perl: ON | cURL: OFF | WGet: ON > / usr / lib / python2.7 / dist-packages / twisted / test / | server ip : 104.21.89.46 your ip : 108.162.216.87 H O M E |
Filename | /usr/lib/python2.7/dist-packages/twisted/test/test_setup.py |
Size | 2 kb |
Permission | rw-r--r-- |
Owner | root : root |
Create time | 27-Apr-2025 09:56 |
Last modified | 03-Oct-2012 21:32 |
Last accessed | 06-Jul-2025 21:50 |
Actions | edit | rename | delete | download (gzip) |
View | text | code | image |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for C{setup.py}, Twisted's distutils integration file.
"""
from __future__ import division, absolute_import
import os, sys
import twisted
from twisted.trial.unittest import SynchronousTestCase
from twisted.python.filepath import FilePath
from twisted.python.dist import getExtensions
# Get rid of the UTF-8 encoding and bytes topfiles segment when FilePath
# supports unicode. #2366, #4736, #5203. Also #4743, which requires checking
# setup.py, not just the topfiles directory.
if not FilePath(twisted.__file__.encode('utf-8')).sibling(b'topfiles').child(b'setup.py').exists():
sourceSkip = "Only applies to source checkout of Twisted"
else:
sourceSkip = None
class TwistedExtensionsTests(SynchronousTestCase):
if sourceSkip is not None:
skip = sourceSkip
def setUp(self):
"""
Change the working directory to the parent of the C{twisted} package so
that L{twisted.python.dist.getExtensions} finds Twisted's own extension
definitions.
"""
self.addCleanup(os.chdir, os.getcwd())
os.chdir(FilePath(twisted.__file__).parent().parent().path)
def test_initgroups(self):
"""
If C{os.initgroups} is present (Python 2.7 and Python 3.3 and newer),
L{twisted.python._initgroups} is not returned as an extension to build
from L{getExtensions}.
"""
extensions = getExtensions()
found = None
for extension in extensions:
if extension.name == "twisted.python._initgroups":
found = extension
if sys.version_info[:2] >= (2, 7):
self.assertIdentical(
None, found,
"Should not have found twisted.python._initgroups extension "
"definition.")
else:
self.assertNotIdentical(
None, found,
"Should have found twisted.python._initgroups extension "
"definition.")
# See LICENSE for details.
"""
Tests for C{setup.py}, Twisted's distutils integration file.
"""
from __future__ import division, absolute_import
import os, sys
import twisted
from twisted.trial.unittest import SynchronousTestCase
from twisted.python.filepath import FilePath
from twisted.python.dist import getExtensions
# Get rid of the UTF-8 encoding and bytes topfiles segment when FilePath
# supports unicode. #2366, #4736, #5203. Also #4743, which requires checking
# setup.py, not just the topfiles directory.
if not FilePath(twisted.__file__.encode('utf-8')).sibling(b'topfiles').child(b'setup.py').exists():
sourceSkip = "Only applies to source checkout of Twisted"
else:
sourceSkip = None
class TwistedExtensionsTests(SynchronousTestCase):
if sourceSkip is not None:
skip = sourceSkip
def setUp(self):
"""
Change the working directory to the parent of the C{twisted} package so
that L{twisted.python.dist.getExtensions} finds Twisted's own extension
definitions.
"""
self.addCleanup(os.chdir, os.getcwd())
os.chdir(FilePath(twisted.__file__).parent().parent().path)
def test_initgroups(self):
"""
If C{os.initgroups} is present (Python 2.7 and Python 3.3 and newer),
L{twisted.python._initgroups} is not returned as an extension to build
from L{getExtensions}.
"""
extensions = getExtensions()
found = None
for extension in extensions:
if extension.name == "twisted.python._initgroups":
found = extension
if sys.version_info[:2] >= (2, 7):
self.assertIdentical(
None, found,
"Should not have found twisted.python._initgroups extension "
"definition.")
else:
self.assertNotIdentical(
None, found,
"Should have found twisted.python._initgroups extension "
"definition.")