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

Class TestChord

source code

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

Tests for the various ways of creating instances of Chord.

Nested Classes [hide private]

Inherited from unittest.case.TestCase: failureException

Instance Methods [hide private]
 
test_from_numerals(self)
Try creating chords using all possbile numerals and check the numeral and root get set correctly.
source code
 
test_set_root(self)
Try setting the root or numeral after a chord is created and check that both values get correctly set.
source code
 
test_init_type(self)
Try creating chords with a particular type and check (a) that they successfully create a chord and (b) that the chord has the right type.
source code
 
test_interval(self)
Try getting the interval between two chords and check it comes out as expected.
source code
 
test_from_name(self)
from_name covers a lot of possible chord instances.
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]
  ALLOWED_NUMERALS = [('C', 0, 'C'), ('Db', 1, 'Db'), ('D', 2, '...

Inherited from unittest.case.TestCase: longMessage, maxDiff

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

test_from_name(self)

source code 

from_name covers a lot of possible chord instances. Here we just test a sample of textual chords and check the instance gets the right attributes out of the name. It's by no means exhaustive!


Class Variable Details [hide private]

ALLOWED_NUMERALS

Value:
[('C', 0, 'C'),
 ('Db', 1, 'Db'),
 ('D', 2, 'D'),
 ('Eb', 3, 'Eb'),
 ('E', 4, 'E'),
 ('F', 5, 'F'),
 ('F#', 6, 'Gb'),
 ('G', 7, 'G'),
...