def test_4_5_hyphens_strict(self):
        parser = ParserCantusVolpiano()
        test_fn = lambda: parser.parse('1---f----f', strict=True)
        self.assertRaises(HyphenationError, test_fn)

        parser = ParserCantusVolpiano()
        test_fn = lambda: parser.parse('1---f-----f', strict=True)
        self.assertRaises(HyphenationError, test_fn)
 def test_too_few_hyphens_before_barline_strict(self):
     parser = ParserCantusVolpiano()
     test_fn = lambda: parser.parse('1---f-3', strict=True)
     self.assertRaises(HyphenationError, test_fn)
     test_fn = lambda: parser.parse('1---f--3', strict=True)
     self.assertRaises(HyphenationError, test_fn)
     test_fn = lambda: parser.parse('1---f--4', strict=True)
     self.assertRaises(HyphenationError, test_fn)
    def test_missing_pitches_hyphenation_strict(self):
        parser = ParserCantusVolpiano()
        test_fn = lambda: parser.parse('1---f--6------6---f', strict=True)
        self.assertRaises(HyphenationError, test_fn)
        test_fn = lambda: parser.parse('1---f---6------6--f', strict=True)
        self.assertRaises(HyphenationError, test_fn)

        test_fn = lambda: parser.parse('1---f---76------677--f', strict=True)
        self.assertRaises(HyphenationError, test_fn)
 def test_too_few_hyphens_after_barline_not_strict(self):
     parser = ParserCantusVolpiano()
     parser.parse('1---f---3-f', strict=False)
     parser.parse('1---f---3--f', strict=False)
     parser.parse('1---f---4-f', strict=False)
     parser.parse('1---f---4--f', strict=False)
     self.assertTrue(True)
 def test_volpiano(self):
     parser = ParserCantusVolpiano(root='volpiano')
     parse = parser.parse('1---fgf-ef--fg-h---f-g')
     word0, bound1, word1, bound2, word2, EOF = parse
     self.assertEqual(word0.rule_name, 'word')
     self.assertEqual(bound1.rule_name, 'word_boundary')
     self.assertEqual(word1.rule_name, 'word')
     self.assertEqual(bound2.rule_name, 'word_boundary')
     self.assertEqual(word2.rule_name, 'word')
     self.assertEqual(EOF.rule_name, 'EOF')
 def test_4_5_hyphens_not_strict(self):
     parser = ParserCantusVolpiano()
     parse = parser.parse('1---f----f-g--g----gf', strict=False)
     self.assertTrue(True)
 def test_missing_clef(self):
     parser = ParserCantusVolpiano()
     test_fn = lambda: parser.parse('f---f')
     self.assertRaises(ClefError, test_fn)
 def test_thick_barline_not_strict(self):
     parser = ParserCantusVolpiano()
     parse = parser.parse('1---f---5', strict=False)
     self.assertTrue(True)
 def test_thick_barline_strict(self):
     parser = ParserCantusVolpiano()
     test_fn = lambda: parser.parse('1---f---5', strict=True)
     self.assertRaises(BarlineError, test_fn)
Esempio n. 10
0
 def test_double_3_not_strict(self):
     parser = ParserCantusVolpiano()
     parse = parser.parse('1---f---33---g', strict=False)
     self.assertTrue(True)
Esempio n. 11
0
 def test_double_3_strict(self):
     parser = ParserCantusVolpiano()
     test_fn = lambda: parser.parse('1---f---33---g', strict=True)
     self.assertRaises(BarlineError, test_fn)
Esempio n. 12
0
 def test_missing_pitches_too_many_hyphens_not_strict(self):
     parser = ParserCantusVolpiano()
     parser.parse('1---6-------6', strict=False)
     parser.parse('1---6-------------6---f', strict=False)
     self.assertTrue(True)
Esempio n. 13
0
 def test_missing_pitches_hyphenation_not_strict(self):
     parser = ParserCantusVolpiano()
     parse = parser.parse('1---f--6------6---f--6------6---g', strict=False)
     self.assertTrue(True)
     parse = parser.parse('1---f---76------677--f', strict=False)
     self.assertTrue(True)
Esempio n. 14
0
 def test_dot_not_strict(self):
     parser = ParserCantusVolpiano()
     parser.parse('1---fg.', strict=False)
     self.assertTrue(True)
Esempio n. 15
0
 def test_dot_strict(self):
     parser = ParserCantusVolpiano()
     test_fn = lambda: parser.parse('1---fg.', strict=True)
     self.assertRaises(UnsupportedCharacterError, test_fn)
Esempio n. 16
0
 def test_alternative_hyphenation_strict(self):
     parser = ParserCantusVolpiano()
     test_fn = lambda: parser.parse('1--fg-f--g', strict=True)
     self.assertRaises(HyphenationError, test_fn)
Esempio n. 17
0
 def test_mixed_hyphenation_not_strict(self):
     parser = ParserCantusVolpiano()
     parse = parser.parse('1--f---f', strict=False)
     self.assertTrue(True)
Esempio n. 18
0
 def test_hyphensAtEnd(self):
     parser = ParserCantusVolpiano()
     parse = parser.parse('1---l-')
     self.assertFalse(parse.error)
     parse = parser.parse('1---l--')
     self.assertFalse(parse.error)
Esempio n. 19
0
 def test_alternative_hyphenation_not_strict(self):
     parser = ParserCantusVolpiano()
     parse = parser.parse('1--fg-f-f--g', strict=False)
     vol = parse.value.replace(' ', '').replace('|', '')
     self.assertEqual(vol, '1---fg--f--f---g')
Esempio n. 20
0
 def test_invalid_clef_hyphenation(self):
     parser = ParserCantusVolpiano()
     test_fn = lambda: parser.parse('1-f---f')
     self.assertRaises(HyphenationError, test_fn)
     test_fn = lambda: parser.parse('1f---f')
     self.assertRaises(HyphenationError, test_fn)