Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
FunctionTestCase Class Reference
Inheritance diagram for FunctionTestCase:
TestCase

Public Member Functions

def __init__
 
def setUp
 
def tearDown
 
def runTest
 
def id
 
def __str__
 
def __repr__
 
def shortDescription
 
- Public Member Functions inherited from TestCase
def __init__
 
def setUp
 
def tearDown
 
def countTestCases
 
def defaultTestResult
 
def shortDescription
 
def id
 
def __str__
 
def __repr__
 
def run
 
def __call__
 
def debug
 
def fail
 
def failIf
 
def failUnless
 
def failUnlessRaises
 
def failUnlessEqual
 
def failIfEqual
 

Additional Inherited Members

- Static Public Attributes inherited from TestCase
 failureException = AssertionError
 
 assertEqual = failUnlessEqual
 
 assertNotEqual = failIfEqual
 
 assertRaises = failUnlessRaises
 
 assert_ = failUnless
 

Detailed Description

A test case that wraps a test function.

This is useful for slipping pre-existing test functions into the
PyUnit framework. Optionally, set-up and tidy-up functions can be
supplied. As with TestCase, the tidy-up ('tearDown') function will
always be called if the set-up ('setUp') function ran successfully.

Definition at line 353 of file unittest.py.

Constructor & Destructor Documentation

def __init__ (   self,
  testFunc,
  setUp = None,
  tearDown = None,
  description = None 
)

Definition at line 363 of file unittest.py.

References FunctionTestCase.__description, FunctionTestCase.__setUpFunc, FunctionTestCase.__tearDownFunc, and FunctionTestCase.__testFunc.

364  description=None):
365  TestCase.__init__(self)
366  self.__setUpFunc = setUp
367  self.__tearDownFunc = tearDown
368  self.__testFunc = testFunc
369  self.__description = description

Member Function Documentation

def __repr__ (   self)

Definition at line 387 of file unittest.py.

References SymbolTable.__class__, and FunctionTestCase.__testFunc.

388  def __repr__(self):
389  return "<%s testFunc=%s>" % (self.__class__, self.__testFunc)
def __str__ (   self)

Definition at line 384 of file unittest.py.

References SymbolTable.__class__.

385  def __str__(self):
386  return "%s (%s)" % (self.__class__, self.__testFunc.__name__)
def id (   self)

Definition at line 381 of file unittest.py.

382  def id(self):
383  return self.__testFunc.__name__
def runTest (   self)

Definition at line 378 of file unittest.py.

References FunctionTestCase.__testFunc.

379  def runTest(self):
380  self.__testFunc()
def setUp (   self)

Definition at line 370 of file unittest.py.

References FunctionTestCase.__setUpFunc.

371  def setUp(self):
372  if self.__setUpFunc is not None:
373  self.__setUpFunc()
def shortDescription (   self)

Definition at line 390 of file unittest.py.

References FunctionTestCase.__description, string.split(), and string.strip().

391  def shortDescription(self):
392  if self.__description is not None: return self.__description
393  doc = self.__testFunc.__doc__
394  return doc and string.strip(string.split(doc, "\n")[0]) or None
395 
396 
def tearDown (   self)

Definition at line 374 of file unittest.py.

References FunctionTestCase.__tearDownFunc.

375  def tearDown(self):
376  if self.__tearDownFunc is not None:
377  self.__tearDownFunc()

The documentation for this class was generated from the following file: