|
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 | : | 24 GB of 70.42 GB (34.08%) |
|
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/
share/
pyshared/
twisted/
trial/
test/
- drwxr-xr-x
|
Viewing file: test_test_visitor.py (2.23 KB) -rw-r--r--Select action/file-type:  ( +) |  ( +) |  ( +) | Code ( +) | Session ( +) |  ( +) | SDB ( +) |  ( +) |  ( +) |  ( +) |  ( +) |  ( +) |
from twisted.trial import unittest from twisted.trial.runner import TestSuite, suiteVisit
pyunit = __import__('unittest')
class MockVisitor(object): def __init__(self): self.calls = []
def __call__(self, testCase): self.calls.append(testCase)
class TestTestVisitor(unittest.TestCase): def setUp(self): self.visitor = MockVisitor()
def test_visitCase(self): """ Test that C{visit} works for a single test case. """ testCase = TestTestVisitor('test_visitCase') testCase.visit(self.visitor) self.assertEqual(self.visitor.calls, [testCase])
def test_visitSuite(self): """ Test that C{visit} hits all tests in a suite. """ tests = [TestTestVisitor('test_visitCase'), TestTestVisitor('test_visitSuite')] testSuite = TestSuite(tests) testSuite.visit(self.visitor) self.assertEqual(self.visitor.calls, tests)
def test_visitEmptySuite(self): """ Test that C{visit} on an empty suite hits nothing. """ TestSuite().visit(self.visitor) self.assertEqual(self.visitor.calls, [])
def test_visitNestedSuite(self): """ Test that C{visit} recurses through suites. """ tests = [TestTestVisitor('test_visitCase'), TestTestVisitor('test_visitSuite')] testSuite = TestSuite([TestSuite([test]) for test in tests]) testSuite.visit(self.visitor) self.assertEqual(self.visitor.calls, tests)
def test_visitPyunitSuite(self): """ Test that C{suiteVisit} visits stdlib unittest suites """ test = TestTestVisitor('test_visitPyunitSuite') suite = pyunit.TestSuite([test]) suiteVisit(suite, self.visitor) self.assertEqual(self.visitor.calls, [test])
def test_visitPyunitCase(self): """ Test that a stdlib test case in a suite gets visited. """ class PyunitCase(pyunit.TestCase): def test_foo(self): pass test = PyunitCase('test_foo') TestSuite([test]).visit(self.visitor) self.assertEqual( [call.id() for call in self.visitor.calls], [test.id()])
|