| Server IP : 103.48.194.25 / Your IP : 216.73.216.131 Web Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.33 System : Linux VMHostDefault 3.10.0-1160.42.2.el7.x86_64 #1 SMP Tue Sep 7 14:49:57 UTC 2021 x86_64 User : sieuthimay ( 1016) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /lib/python2.7/site-packages/zope/component/tests/ |
Upload File : |
##############################################################################
#
# Copyright (c) 2001, 2002, 2009 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Component Architecture Tests
"""
import unittest
class StandaloneTests(unittest.TestCase):
def testStandalone(self):
# See: https://bugs.launchpad.net/zope3/+bug/98401
import subprocess
import sys
import os
import pickle
executable = os.path.abspath(sys.executable)
where = os.path.dirname(os.path.dirname(__file__))
program = os.path.join(where, 'standalonetests.py')
process = subprocess.Popen([executable, program],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
stdin=subprocess.PIPE)
pickle.dump(sys.path, process.stdin)
process.stdin.close()
try:
rc = process.wait()
except OSError as e:
if e.errno != 4: # MacIntel raises apparently unimportant EINTR?
raise # TODO verify sanity of a pass on EINTR :-/
if rc != 0:
output = process.stdout.read()
output = output.decode() if isinstance(output, bytes) else output
sys.stderr.write('#' * 80 + '\n')
sys.stdout.write(output)
sys.stderr.write('#' * 80 + '\n')
self.fail('Output code: %d' % rc)
def test_suite():
return unittest.TestSuite((
unittest.makeSuite(StandaloneTests),
))