Mercurial > public > m209
changeset 10:1e1c4b41135d
Added a test for Drum.to_key_list().
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Tue, 04 Jun 2013 18:49:12 -0500 |
parents | a29fa17cefc4 |
children | 45af97a43ee1 |
files | m209/tests/test_drum.py |
diffstat | 1 files changed, 10 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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'))