IMP logo

IMP::test::TestCase Class Reference


Detailed Description

Super class for IMP test cases.
Inheritance diagram for IMP::test::TestCase:

Inheritance graph
[legend]

Public Member Functions

def assertInTolerance
 Assert that the difference between num1 and num2 is less than tolerance.
def assertPlural
 Check that all the classes in modulename have associated types to hold many of them.
def assertShow
 Check that all the classes in modulename have a show method.
def assertXYZDerivativesInTolerance
 Assert that x,y,z analytical derivatives match numerical within a tolerance, or a percentage (of the analytical value), whichever is larger.
def check_unary_function_deriv
 Check the unary function func's derivatives against numerical approximations between lb and ub.
def check_unary_function_min
 Make sure that the minimum of the unary function func over the range between lb and ub is at expected_fmin.
def create_particles_in_box
 Create a bunch of particles in a box.
def create_point_particle
 Make a particle with optimizable x, y and z attributes, and add it to the model.
def failure_probability
 Estimate how like a given block of code is to raise an AssertionError.
def get_input_file_name
 Get the full name of an input file in the top-level test directory.
def get_tmp_file_name
 Get the full name of an output file in the build/tmp directory.
def open_input_file
 Open and return an input file in the top-level test directory.
def particle_distance
 Return distance between two given particles.
def probabilistic_test
 Help handle a test which is expected to fail some fraction of the time.
def randomize_particles
 Randomize the xyz coordinates of a list of particles.
def setUp
def tearDown

Member Function Documentation

def IMP::test::TestCase::assertPlural (   self,
  modulename,
  exceptions 
)

Check that all the classes in modulename have associated types to hold many of them.

def IMP::test::TestCase::assertXYZDerivativesInTolerance (   self,
  model,
  xyz,
  tolerance,
  percentage 
)

Assert that x,y,z analytical derivatives match numerical within a tolerance, or a percentage (of the analytical value), whichever is larger.

def IMP::test::TestCase::create_point_particle (   self,
  model,
  x,
  y,
  z 
)

Make a particle with optimizable x, y and z attributes, and add it to the model.

def IMP::test::TestCase::failure_probability (   self,
  testcall 
)

Estimate how like a given block of code is to raise an AssertionError.

def IMP::test::TestCase::get_input_file_name (   self,
  filename 
)

Get the full name of an input file in the top-level test directory.

def IMP::test::TestCase::get_tmp_file_name (   self,
  filename 
)

Get the full name of an output file in the build/tmp directory.

def IMP::test::TestCase::open_input_file (   self,
  filename,
  mode = 'rb' 
)

Open and return an input file in the top-level test directory.

def IMP::test::TestCase::probabilistic_test (   self,
  testcall,
  chance_of_failure 
)

Help handle a test which is expected to fail some fraction of the time.

The test is run multiple times and an exception is thrown only if it fails too many times.


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

Generated on Mon Mar 8 23:09:03 2010 for IMP by doxygen 1.5.8