|
System | : | Linux MiraNet 3.0.0-14-generic-pae #23-Ubuntu SMP Mon Nov 21 22:07:10 UTC 2011 i686 |
Software | : | Apache. PHP/5.3.6-13ubuntu3.10 |
ID | : | uid=65534(nobody) gid=65534(nogroup) groups=65534(nogroup)
|
|
Safe Mode | : | OFF |
Open_Basedir | : | OFF |
Freespace | : | 22.24 GB of 70.42 GB (31.59%) |
|
MySQL: ON MSSQL: OFF Oracle: OFF PostgreSQL: OFF Curl: OFF Sockets: ON Fetch: OFF Wget: ON Perl: ON |
Disabled Functions: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
|
[ System Info ]
[ Processes ]
[ SQL Manager ]
[ Eval ]
[ Encoder ]
[ Mailer ]
[ Back Connection ]
[ Backdoor Server ]
[ Kernel Exploit Search ]
[ MD5 Decrypter ]
[ Reverse IP ]
[ Kill Shell ]
[ FTP Brute-Force ]
|
|
/
usr/
lib/
python2.7/
dist-packages/
twisted/
trial/
test/
- drwxr-xr-x
|
Viewing file: test_doctest.py (2.34 KB) -rw-r--r--Select action/file-type:  ( +) |  ( +) |  ( +) | Code ( +) | Session ( +) |  ( +) | SDB ( +) |  ( +) |  ( +) |  ( +) |  ( +) |  ( +) |
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details.
""" Test twisted's doctest support. """
from twisted.trial import itrial, runner, unittest, reporter from twisted.trial.test import mockdoctest
class TestRunners(unittest.TestCase): """ Tests for Twisted's doctest support. """
def test_id(self): """ Check that the id() of the doctests' case object contains the FQPN of the actual tests. We need this because id() has weird behaviour w/ doctest in Python 2.3. """ loader = runner.TestLoader() suite = loader.loadDoctests(mockdoctest) idPrefix = 'twisted.trial.test.mockdoctest.Counter' for test in suite._tests: self.assertIn(idPrefix, itrial.ITestCase(test).id())
def makeDocSuite(self, module): """ Return a L{runner.DocTestSuite} for the doctests in C{module}. """ return self.assertWarns( DeprecationWarning, "DocTestSuite is deprecated in Twisted 8.0.", __file__, lambda: runner.DocTestSuite(mockdoctest))
def test_correctCount(self): """ L{countTestCases} returns the number of doctests in the module. """ suite = self.makeDocSuite(mockdoctest) self.assertEqual(7, suite.countTestCases())
def test_basicTrialIntegration(self): """ L{loadDoctests} loads all of the doctests in the given module. """ loader = runner.TestLoader() suite = loader.loadDoctests(mockdoctest) self.assertEqual(7, suite.countTestCases())
def _testRun(self, suite): """ Run C{suite} and check the result. """ result = reporter.TestResult() suite.run(result) self.assertEqual(5, result.successes) # doctest reports failures as errors in 2.3 self.assertEqual(2, len(result.errors) + len(result.failures))
def test_expectedResults(self, count=1): """ Trial can correctly run doctests with its xUnit test APIs. """ suite = runner.TestLoader().loadDoctests(mockdoctest) self._testRun(suite)
def test_repeatable(self): """ Doctests should be runnable repeatably. """ suite = runner.TestLoader().loadDoctests(mockdoctest) self._testRun(suite) self._testRun(suite)
|