def test_dotted_notes(self): self.assertEqual( LilyPond.from_NoteContainer(NoteContainer("C"), value.dots(8), standalone=False), "c'8.", ) self.assertEqual( LilyPond.from_NoteContainer(NoteContainer("C"), value.dots(4, 2), standalone=False), "c'4..", )
def test_from_NoteContainer(self): self.assertEqual( LilyPond.from_NoteContainer(NoteContainer("C"), standalone=False), "c'") self.assertEqual( LilyPond.from_NoteContainer(NoteContainer("C"), 4, standalone=False), "c'4") self.assertEqual( LilyPond.from_NoteContainer(NoteContainer(["C", "E"]), standalone=False), "<c' e'>", ) self.assertEqual( LilyPond.from_NoteContainer(NoteContainer(["C", "E"]), 4, standalone=False), "<c' e'>4", ) # issue #37 self.assertEqual( LilyPond.from_NoteContainer(NoteContainer("C"), 16, standalone=False), "c'16", ) self.assertEqual( LilyPond.from_NoteContainer(NoteContainer("C"), 16.0, standalone=False), "c'16", ) self.assertEqual( LilyPond.from_NoteContainer(NoteContainer("C"), value.dots(16), standalone=False), "c'16.", ) self.assertEqual( LilyPond.from_NoteContainer(NoteContainer("C"), 0.25, standalone=False), "c'\\longa", ) self.assertEqual( LilyPond.from_NoteContainer(NoteContainer("C"), 0.5, standalone=False), "c'\\breve", )
def test_from_NoteContainer(self): self.assertEqual(LilyPond.from_NoteContainer(NoteContainer("C"), standalone=False), "c'") self.assertEqual(LilyPond.from_NoteContainer(NoteContainer("C"), 4, standalone=False), "c'4") self.assertEqual(LilyPond.from_NoteContainer(NoteContainer(["C", "E"]), standalone=False), "<c' e'>") self.assertEqual(LilyPond.from_NoteContainer(NoteContainer(["C", "E"]), 4, standalone=False), "<c' e'>4") # issue #37 self.assertEqual(LilyPond.from_NoteContainer(NoteContainer("C"), 16, standalone=False), "c'16") self.assertEqual(LilyPond.from_NoteContainer(NoteContainer("C"), 16.0, standalone=False), "c'16") self.assertEqual(LilyPond.from_NoteContainer(NoteContainer("C"), value.dots(16), standalone=False), "c'16.") self.assertEqual(LilyPond.from_NoteContainer(NoteContainer("C"), 0.25, standalone=False), "c'\\longa") self.assertEqual(LilyPond.from_NoteContainer(NoteContainer("C"), 0.5, standalone=False), "c'\\breve")
def test_to_pdf(self): self.assert_( LilyPond.to_pdf( "{ %s }" % LilyPond.from_NoteContainer(NoteContainer("C"), value.dots(8)), "pdftest first test" ) ) self.assert_(LilyPond.to_pdf(LilyPond.from_Bar(self.tbar), "pdftest2")) self.assert_(LilyPond.to_pdf(LilyPond.from_Bar(self.mbar), "pdftest3"))
def test_to_png(self): self.assert_( LilyPond.to_png( '{ %s }' % LilyPond.from_NoteContainer(NoteContainer('C'), value.dots(8)), 'pn1')) self.assert_(LilyPond.to_png(LilyPond.from_Bar(self.tbar), 'pn2')) self.assert_(LilyPond.to_png(LilyPond.from_Bar(self.mbar), 'pn3'))
def test_to_pdf(self): self.assert_( LilyPond.to_pdf( '{ %s }' % LilyPond.from_NoteContainer(NoteContainer('C'), value.dots(8)), 'pdftest first test')) self.assert_(LilyPond.to_pdf(LilyPond.from_Bar(self.tbar), 'pdftest2')) self.assert_(LilyPond.to_pdf(LilyPond.from_Bar(self.mbar), 'pdftest3'))
def test_to_png(self): self.assertTrue( LilyPond.to_png( "{ %s }" % LilyPond.from_NoteContainer(NoteContainer("C"), value.dots(8)), "pn1", )) self.assertTrue(LilyPond.to_png(LilyPond.from_Bar(self.tbar), "pn2")) self.assertTrue(LilyPond.to_png(LilyPond.from_Bar(self.mbar), "pn3"))
def test_to_pdf(self): self.assertTrue( LilyPond.to_pdf( "{ %s }" % LilyPond.from_NoteContainer(NoteContainer("C"), value.dots(8)), "pdftest first test", ) ) self.assertTrue(LilyPond.to_pdf(LilyPond.from_Bar(self.tbar), "pdftest2")) self.assertTrue(LilyPond.to_pdf(LilyPond.from_Bar(self.mbar), "pdftest3"))
def test_from_NoteContainer(self): self.assertEqual(LilyPond.from_NoteContainer(NoteContainer('C'), standalone=False), "c'") self.assertEqual(LilyPond.from_NoteContainer(NoteContainer('C'), 4, standalone=False), "c'4") self.assertEqual(LilyPond.from_NoteContainer(NoteContainer(['C', 'E']), standalone=False), "<c' e'>") self.assertEqual(LilyPond.from_NoteContainer(NoteContainer(['C', 'E']), 4, standalone=False), "<c' e'>4") # issue #37 self.assertEqual(LilyPond.from_NoteContainer(NoteContainer('C'), 16, standalone=False), "c'16") self.assertEqual(LilyPond.from_NoteContainer(NoteContainer('C'), 16.0, standalone=False), "c'16") self.assertEqual(LilyPond.from_NoteContainer(NoteContainer('C'), value.dots(16), standalone=False), "c'16.") self.assertEqual(LilyPond.from_NoteContainer(NoteContainer('C'), 0.25, standalone=False), "c'\\longa") self.assertEqual(LilyPond.from_NoteContainer(NoteContainer('C'), 0.5, standalone=False), "c'\\breve")
def test_to_png(self): self.assert_(LilyPond.to_png('{ %s }' % LilyPond.from_NoteContainer(NoteContainer('C'), value.dots(8)), 'pn1')) self.assert_(LilyPond.to_png(LilyPond.from_Bar(self.tbar), 'pn2')) self.assert_(LilyPond.to_png(LilyPond.from_Bar(self.mbar), 'pn3'))
def test_to_pdf(self): self.assert_(LilyPond.to_pdf('{ %s }' % LilyPond.from_NoteContainer(NoteContainer('C'), value.dots(8)), 'pdftest first test')) self.assert_(LilyPond.to_pdf(LilyPond.from_Bar(self.tbar), 'pdftest2')) self.assert_(LilyPond.to_pdf(LilyPond.from_Bar(self.mbar), 'pdftest3'))
def test_dotted_notes(self): self.assertEqual(LilyPond.from_NoteContainer(NoteContainer('C'), value.dots(8), standalone=False), "c'8.") self.assertEqual(LilyPond.from_NoteContainer(NoteContainer('C'), value.dots(4, 2), standalone=False), "c'4..")
def test_to_png(self): self.assert_(LilyPond.to_png("{ %s }" % LilyPond.from_NoteContainer(NoteContainer("C"), value.dots(8)), "pn1")) self.assert_(LilyPond.to_png(LilyPond.from_Bar(self.tbar), "pn2")) self.assert_(LilyPond.to_png(LilyPond.from_Bar(self.mbar), "pn3"))