# HG changeset patch # User Brian Neal # Date 1370389752 18000 # Node ID 1e1c4b41135d31fe39b26be758d244298440cc2f # Parent a29fa17cefc4cc6514486036ebea646f57f18b87 Added a test for Drum.to_key_list(). diff -r a29fa17cefc4 -r 1e1c4b41135d m209/tests/test_drum.py --- a/m209/tests/test_drum.py Mon Jun 03 21:43:36 2013 -0500 +++ b/m209/tests/test_drum.py Tue Jun 04 18:49:12 2013 -0500 @@ -128,3 +128,13 @@ drum = Drum([(2, 4)] * 10) self.assertEqual(10, drum.rotate([False, False, False, False, True, False])) + + def test_to_key_list(self): + + drum = Drum.from_key_list('1-0*5 0-3*3 0-4 0-5*4 0-6*6 1-2 1-5*4 3-4 3-6 5-6') + s = drum.to_key_list() + self.assertEqual(s, '0-4 0-5*4 0-6*6 1-0*5 1-2 1-5*4 3-0*3 3-4 3-6 5-6') + + s = drum.to_key_list(shortcut=False) + self.assertEqual(s, ('0-4 0-5 0-5 0-5 0-5 0-6 0-6 0-6 0-6 0-6 0-6 1-0 ' + '1-0 1-0 1-0 1-0 1-2 1-5 1-5 1-5 1-5 3-0 3-0 3-0 3-4 3-6 5-6'))