# Path: MuseParse/tests/testLilyMethods/lily.py
# class Lily(unittest.TestCase):
# 
#     def setUp(self):
#         self.compile = False
#         self.wrappers = []
# 
#     def testValue(self):
#         if hasattr(self, "lilystring"):
#             if hasattr(self, "item"):
#                 self.assertEqual(self.lilystring, self.item.toLily())
# 
#     def testCompilation(self):
#         if hasattr(self, "compile") and self.compile is True:
# 
#             filepath = expanduser("~")
#             script = ''
#             if sys.platform == 'darwin':
#                 script = os.path.join(filepath, 'bin', 'lilypond')
#             filepath = os.path.join(filepath, self.name)
#             if self.compile and hasattr(self, "item"):
#                 if os.path.exists(filepath + ".pdf"):
#                     os.remove(filepath + ".pdf")
# 
#                 ly = LilypondOutput.LilypondRenderer(
#                     self.item, filepath + ".xml", script)
#                 if hasattr(self, "wrappers"):
#                     ly.run(wrappers=self.wrappers)
#                 else:
#                     ly.run()
#                 self.assertTrue(os.path.exists(filepath + ".pdf"))
# 
# Path: MuseParse/classes/ObjectHierarchy/ItemClasses/Key.py
# class Key(object):
# 
#     """
#     key signature class
# 
# 
#     # Optional inputs
# 
#             - fifths: the number of fifths in the key sig. int
# 
#             - mode: major/minor
#     """
# 
#     def __init__(self, **kwargs):
#         if "fifths" in kwargs:
#             self.fifths = kwargs["fifths"]
#         if "mode" in kwargs:
#             self.mode = kwargs["mode"]
# 
#     def __str__(self):
#         if hasattr(self, "fifths"):
#             if hasattr(self, "mode"):
#                 if self.mode == "major":
#                     return majors[self.fifths] + " major"
#                 if self.mode == "minor":
#                     return minors[self.fifths] + " minor"
# 
#     def toLily(self):
#         val = "\key"
#         if hasattr(self, "fifths"):
#             if hasattr(self, "mode"):
#                 keyname = ""
#                 if self.mode == "major":
#                     if self.fifths in majors:
#                         keyname = majors[self.fifths].lower()
#                 if self.mode == "minor":
#                     if self.fifths in minors:
#                         keyname = minors[self.fifths].lower()
#                 if len(keyname) > 1:
#                     symbol = keyname[1:len(keyname)]
#                     if symbol == "flat":
#                         keyname = keyname[0] + "es"
#                     if symbol == "sharp":
#                         keyname = keyname[0] + "is"
#                 val += " " + keyname
#                 val += " \\" + self.mode
#             else:
#                 val = ""
#         else:
#             val = ""
#         return val


from MuseParse.tests.testLilyMethods.lily import Lily
from MuseParse.classes.ObjectHierarchy.ItemClasses import Key


class testKey(Lily):

    def setUp(self):
        self.item = Key.Key()
        self.lilystring = ""


class testKeyFifths(Lily):

    def setUp(self):
        self.item = Key.Key(fifths=1)
        self.lilystring = ""


class testKeyMode(Lily):

    def setUp(self):
        self.item = Key.Key(mode="minor")
        self.lilystring = ""


class testKeyFifthsMode(Lily):

    def setUp(self):

# Path: MuseParse/tests/testLilyMethods/lily.py
# class Lily(unittest.TestCase):
# 
#     def setUp(self):
#         self.compile = False
#         self.wrappers = []
# 
#     def testValue(self):
#         if hasattr(self, "lilystring"):
#             if hasattr(self, "item"):
#                 self.assertEqual(self.lilystring, self.item.toLily())
# 
#     def testCompilation(self):
#         if hasattr(self, "compile") and self.compile is True:
# 
#             filepath = expanduser("~")
#             script = ''
#             if sys.platform == 'darwin':
#                 script = os.path.join(filepath, 'bin', 'lilypond')
#             filepath = os.path.join(filepath, self.name)
#             if self.compile and hasattr(self, "item"):
#                 if os.path.exists(filepath + ".pdf"):
#                     os.remove(filepath + ".pdf")
# 
#                 ly = LilypondOutput.LilypondRenderer(
#                     self.item, filepath + ".xml", script)
#                 if hasattr(self, "wrappers"):
#                     ly.run(wrappers=self.wrappers)
#                 else:
#                     ly.run()
#                 self.assertTrue(os.path.exists(filepath + ".pdf"))
# 
# Path: MuseParse/classes/ObjectHierarchy/ItemClasses/Key.py
# class Key(object):
# 
#     """
#     key signature class
# 
# 
#     # Optional inputs
# 
#             - fifths: the number of fifths in the key sig. int
# 
#             - mode: major/minor
#     """
# 
#     def __init__(self, **kwargs):
#         if "fifths" in kwargs:
#             self.fifths = kwargs["fifths"]
#         if "mode" in kwargs:
#             self.mode = kwargs["mode"]
# 
#     def __str__(self):
#         if hasattr(self, "fifths"):
#             if hasattr(self, "mode"):
#                 if self.mode == "major":
#                     return majors[self.fifths] + " major"
#                 if self.mode == "minor":
#                     return minors[self.fifths] + " minor"
# 
#     def toLily(self):
#         val = "\key"
#         if hasattr(self, "fifths"):
#             if hasattr(self, "mode"):
#                 keyname = ""
#                 if self.mode == "major":
#                     if self.fifths in majors:
#                         keyname = majors[self.fifths].lower()
#                 if self.mode == "minor":
#                     if self.fifths in minors:
#                         keyname = minors[self.fifths].lower()
#                 if len(keyname) > 1:
#                     symbol = keyname[1:len(keyname)]
#                     if symbol == "flat":
#                         keyname = keyname[0] + "es"
#                     if symbol == "sharp":
#                         keyname = keyname[0] + "is"
#                 val += " " + keyname
#                 val += " \\" + self.mode
#             else:
#                 val = ""
#         else:
#             val = ""
#         return val


# Path: MuseParse/tests/testLilyMethods/testKey.py
from MuseParse.tests.testLilyMethods.lily import Lily
from MuseParse.classes.ObjectHierarchy.ItemClasses import Key



class testKey(Lily):

    def setUp(self):
        self.item = Key.Key()
        self.lilystring = ""


class testKeyFifths(Lily):

    def setUp(self):
        self.item = Key.Key(fifths=1)
        self.lilystring = ""


class testKeyMode(Lily):

    def setUp(self):
        self.item = Key.Key(mode="minor")
        self.lilystring = ""


class testKeyFifthsMode(Lily):

    def setUp(self):

        self.item = Key.Key(fifths=-3, mode="minor")