| |
- BadSamples
- DepthLookup
- SampleName
- unittest.TestCase(__builtin__.object)
-
- TTN136BTests
class BadSamples |
| |
Methods defined here:
- __init__(self, db_cx, corenum, type='pcanrm', coretype='p', corehalf='w', verbosity=0, tablename='badpoints')
- Generate a list of bad samples from the database
- __str__(self)
- isBad(self, item)
- True if item is in set
set requires python >= 2.4
|
class DepthLookup |
| |
Methods defined here:
- __init__(self, db_cx)
- Lookup the section table and make a dictionary. Loads from the database section table
- isNameNotBase(self, sampleNameStr)
- Return true if sample name looks like ttn136b-02pc-182 (BAD BAD BAD)
base name is of the form ttn136b-02pw-s2-120... This is the
name that I prefer to work with. Makes joins easier.
- lookup(self, sampleNameStr)
- Return the depth in cm
Use this lookup to go faster than constant database access to get depths
- lookup2(self, corenum, coretype, section, relativedepth)
- corenum - 1..7
coretype - t for trigger, p for piston
section - section of the core. 1 is the upper most section (close to bottom-water interface)
relativedepth - depth in cm in that section
lookup2(2,'t','1',13)
- revertName(self, badSampleNameStr)
- convert ttn136b-02pc-182 to ttn136b-02pw-s2-120!!!
|
class SampleName |
|
Parse a Kurt style pmag sample cube name |
|
Methods defined here:
- __init__(self, nameString='')
- __str__(self)
- Reconstruct the original sample name string
|
class TTN136BTests(unittest.TestCase) |
|
Unit Tests to make sure all is well
Run the test cases by doing:
./ttn136b.py |
|
- Method resolution order:
- TTN136BTests
- unittest.TestCase
- __builtin__.object
Methods defined here:
- test_SampleName1(self)
- Test the sample name parsing - no section number - abs depth
Methods inherited from unittest.TestCase:
- __call__(self, *args, **kwds)
- __init__(self, methodName='runTest')
- Create an instance of the class that will use the named test
method when executed. Raises a ValueError if the instance does
not have a method with the specified name.
- __repr__(self)
- __str__(self)
- assertAlmostEqual = failUnlessAlmostEqual(self, first, second, places=7, msg=None)
- Fail if the two objects are unequal as determined by their
difference rounded to the given number of decimal places
(default 7) and comparing to zero.
Note that decimal places (from zero) are usually not the same
as significant digits (measured from the most signficant digit).
- assertAlmostEquals = failUnlessAlmostEqual(self, first, second, places=7, msg=None)
- Fail if the two objects are unequal as determined by their
difference rounded to the given number of decimal places
(default 7) and comparing to zero.
Note that decimal places (from zero) are usually not the same
as significant digits (measured from the most signficant digit).
- assertEqual = failUnlessEqual(self, first, second, msg=None)
- Fail if the two objects are unequal as determined by the '=='
operator.
- assertEquals = failUnlessEqual(self, first, second, msg=None)
- Fail if the two objects are unequal as determined by the '=='
operator.
- assertFalse = failIf(self, expr, msg=None)
- Fail the test if the expression is true.
- assertNotAlmostEqual = failIfAlmostEqual(self, first, second, places=7, msg=None)
- Fail if the two objects are equal as determined by their
difference rounded to the given number of decimal places
(default 7) and comparing to zero.
Note that decimal places (from zero) are usually not the same
as significant digits (measured from the most signficant digit).
- assertNotAlmostEquals = failIfAlmostEqual(self, first, second, places=7, msg=None)
- Fail if the two objects are equal as determined by their
difference rounded to the given number of decimal places
(default 7) and comparing to zero.
Note that decimal places (from zero) are usually not the same
as significant digits (measured from the most signficant digit).
- assertNotEqual = failIfEqual(self, first, second, msg=None)
- Fail if the two objects are equal as determined by the '=='
operator.
- assertNotEquals = failIfEqual(self, first, second, msg=None)
- Fail if the two objects are equal as determined by the '=='
operator.
- assertRaises = failUnlessRaises(self, excClass, callableObj, *args, **kwargs)
- Fail unless an exception of class excClass is thrown
by callableObj when invoked with arguments args and keyword
arguments kwargs. If a different type of exception is
thrown, it will not be caught, and the test case will be
deemed to have suffered an error, exactly as for an
unexpected exception.
- assertTrue = failUnless(self, expr, msg=None)
- Fail the test unless the expression is true.
- assert_ = failUnless(self, expr, msg=None)
- Fail the test unless the expression is true.
- countTestCases(self)
- debug(self)
- Run the test without collecting errors in a TestResult
- defaultTestResult(self)
- fail(self, msg=None)
- Fail immediately, with the given message.
- failIf(self, expr, msg=None)
- Fail the test if the expression is true.
- failIfAlmostEqual(self, first, second, places=7, msg=None)
- Fail if the two objects are equal as determined by their
difference rounded to the given number of decimal places
(default 7) and comparing to zero.
Note that decimal places (from zero) are usually not the same
as significant digits (measured from the most signficant digit).
- failIfEqual(self, first, second, msg=None)
- Fail if the two objects are equal as determined by the '=='
operator.
- failUnless(self, expr, msg=None)
- Fail the test unless the expression is true.
- failUnlessAlmostEqual(self, first, second, places=7, msg=None)
- Fail if the two objects are unequal as determined by their
difference rounded to the given number of decimal places
(default 7) and comparing to zero.
Note that decimal places (from zero) are usually not the same
as significant digits (measured from the most signficant digit).
- failUnlessEqual(self, first, second, msg=None)
- Fail if the two objects are unequal as determined by the '=='
operator.
- failUnlessRaises(self, excClass, callableObj, *args, **kwargs)
- Fail unless an exception of class excClass is thrown
by callableObj when invoked with arguments args and keyword
arguments kwargs. If a different type of exception is
thrown, it will not be caught, and the test case will be
deemed to have suffered an error, exactly as for an
unexpected exception.
- id(self)
- run(self, result=None)
- setUp(self)
- Hook method for setting up the test fixture before exercising it.
- shortDescription(self)
- Returns a one-line description of the test, or None if no
description has been provided.
The default implementation of this method returns the first line of
the specified test method's docstring.
- tearDown(self)
- Hook method for deconstructing the test fixture after testing it.
Data and other attributes inherited from unittest.TestCase:
- __dict__ = <dictproxy object>
- dictionary for instance variables (if defined)
- __weakref__ = <attribute '__weakref__' of 'TestCase' objects>
- list of weak references to the object (if defined)
- failureException = <class exceptions.AssertionError>
- Assertion failed.
| |