Esempio n. 1
0
 def test_empty_list(self) -> None:
     """Test when the input list is empty."""
     self.assertEqual(musical_hash.get_scale([]), 0x0,
                      'Scale should have no notes.')
Esempio n. 2
0
 def test_invalid_notes(self) -> None:
     """Test when the input list contains invalid notes."""
     with self.assertRaises(ValueError):
         musical_hash.get_scale(['A', 'Foo', 'Bar'])
Esempio n. 3
0
 def test_twelve_notes(self) -> None:
     """Test when the input list has twelve elements."""
     self.assertEqual(
         musical_hash.get_scale([
             'A', '#A', 'B', 'C', '#C', 'D', '#D', 'E', 'F', '#F', 'G', '#G'
         ]), 0xfff, 'Scale should contain all notes.')
Esempio n. 4
0
 def test_duplicate_notes(self) -> None:
     """Test when the input list has duplicate notes."""
     self.assertEqual(musical_hash.get_scale(['A', '#A', 'bB', 'C', 'C']),
                      0x00b, 'Duplicate notes should be handled.')
Esempio n. 5
0
 def test_one_note(self) -> None:
     """Test when the input list has one element."""
     self.assertEqual(musical_hash.get_scale(['A']), 0x1,
                      'Scale should only have an A')