Package jptests :: Package data :: Module init :: Class TestFraction
[hide private]
[frames] | no frames]

Class TestFraction

source code

            object --+    
                     |    
unittest.case.TestCase --+
                         |
                        TestFraction

Tests for jazzparser.data.Fraction.

Nested Classes [hide private]

Inherited from unittest.case.TestCase: failureException

Instance Methods [hide private]
 
test_create_int(self)
Simplest instantiation: int
source code
 
test_create_fraction(self)
Simplest instantiation: fraction
source code
 
test_simplify(self)
Basic test of simplification of fractions.
source code
 
test_create_string(self)
Test creating a fraction from a string representation.
source code
 
test_reparse_string(self)
Create some random fractions, get their string representation and check the this can by used to correctly reinstantiate the fraction.
source code
 
test_zero_denominator(self)
Setting a Fraction's denominator to 0 should raise an error.
source code
 
test_add(self)
Try adding Fractions together.
source code
 
test_neg(self)
Try negating Fractions
source code
 
test_sub(self)
Test subtraction
source code
 
test_mul(self)
Test multiplication
source code
 
test_div(self)
Test division
source code
 
test_float(self)
Conversion to float
source code
 
test_long(self)
Conversion to long
source code
 
test_int(self)
Conversion to int
source code
 
test_equal(self)
Test that equal Fractions evaluate as equal
source code

Inherited from unittest.case.TestCase: __call__, __eq__, __hash__, __init__, __ne__, __repr__, __str__, addCleanup, addTypeEqualityFunc, assertAlmostEqual, assertAlmostEquals, assertDictContainsSubset, assertDictEqual, assertEqual, assertEquals, assertFalse, assertGreater, assertGreaterEqual, assertIn, assertIs, assertIsInstance, assertIsNone, assertIsNot, assertIsNotNone, assertItemsEqual, assertLess, assertLessEqual, assertListEqual, assertMultiLineEqual, assertNotAlmostEqual, assertNotAlmostEquals, assertNotEqual, assertNotEquals, assertNotIn, assertNotIsInstance, assertNotRegexpMatches, assertRaises, assertRaisesRegexp, assertRegexpMatches, assertSequenceEqual, assertSetEqual, assertTrue, assertTupleEqual, assert_, countTestCases, debug, defaultTestResult, doCleanups, fail, failIf, failIfAlmostEqual, failIfEqual, failUnless, failUnlessAlmostEqual, failUnlessEqual, failUnlessRaises, id, run, setUp, shortDescription, skipTest, tearDown

Inherited from unittest.case.TestCase (private): _addSkip, _baseAssertEqual, _deprecate, _formatMessage, _getAssertEqualityFunc, _truncateMessage

Inherited from object: __delattr__, __format__, __getattribute__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Class Methods [hide private]

Inherited from unittest.case.TestCase: setUpClass, tearDownClass

Class Variables [hide private]

Inherited from unittest.case.TestCase: longMessage, maxDiff

Inherited from unittest.case.TestCase (private): _classSetupFailed, _diffThreshold

Properties [hide private]

Inherited from object: __class__