Exemplo n.º 1
0
 def test_set_NoteNumber(self):
     f = FundamentalTone(hz=440, pitchClass=9, octaveClass=5)
     self.assertEqual(9, f.PitchClass)
     self.assertEqual(5, f.OctaveClass)
     self.assertEqual(69, f.NoteNumber)
     f.NoteNumber = 56
     self.assertEqual(8, f.PitchClass)
     self.assertEqual(4, f.OctaveClass)
     self.assertEqual(56, f.NoteNumber)
Exemplo n.º 2
0
 def test_set_NoteNumber_Invalid_Type(self):
     with self.assertRaises(TypeError) as e:
         f = FundamentalTone(hz=440, pitchClass=9, octaveClass=5)
         f.NoteNumber = 'n'
     self.assertIn('引数halfToneNumはint型にしてください。', str(e.exception))