# Path: compmusic/tags.py
# def has_carnatic_form(tag):
# def has_raaga(tag):
# def has_taala(tag):
# def has_raag(tag):
# def has_taal(tag):
# def has_laya(tag):
# def has_section(tag):
# def has_makam(tag):
# def has_usul(tag):
# def has_makam_form(tag):
# def has_hindustani_form(tag):
# def parse_raaga(raaga):
# def parse_taala(taala):
# def parse_makam(makam):
# def _parse_num_and_value(expression, target):
# def parse_usul(usul):
# def parse_makam_form(form):
# def parse_raag(raag):
# def parse_taal(taal):
# def parse_hindustani_form(form):
# def parse_carnatic_form(form):
# def parse_laya(laya):
# def group_makam_tags(makams, forms, usuls):


import unittest
from compmusic import tags

    def test_group_makam_tags(self):
        makams = [(0, "beyati")]
        forms = [(0, "peşrev")]
        usuls = [(0, "hafif")]

        groups = tags.group_makam_tags(makams, forms, usuls)
        self.assertEqual(1, len(groups))
        g = groups[0]
        self.assertEqual("beyati", g["makam"])
        self.assertEqual("peşrev", g["form"])
        self.assertEqual("hafif", g["usul"])

        # Test two sets of tags
        makams = [(0, "Zilkeş"), (1, "Uşşak")]
        forms = [(0, "Sirto"), (1, "Peşrev")]
        usuls = [(0, "Sofyan"), (1, "Remel")]
        groups = tags.group_makam_tags(makams, forms, usuls)
        self.assertEqual(2, len(groups))
        g = groups[0]
        self.assertEqual("Zilkeş", g["makam"])
        g = groups[1]
        self.assertEqual("Uşşak", g["makam"])
        self.assertEqual("Peşrev", g["form"])
        self.assertEqual("Remel", g["usul"])

        # Missing a tag on the last number
        makams = [(0, "Zilkeş")]
        forms = [(0, "Sirto"), (1, "Peşrev")]
        usuls = [(0, "Sofyan"), (1, "Remel")]

# Path: compmusic/tags.py
# def has_carnatic_form(tag):
# def has_raaga(tag):
# def has_taala(tag):
# def has_raag(tag):
# def has_taal(tag):
# def has_laya(tag):
# def has_section(tag):
# def has_makam(tag):
# def has_usul(tag):
# def has_makam_form(tag):
# def has_hindustani_form(tag):
# def parse_raaga(raaga):
# def parse_taala(taala):
# def parse_makam(makam):
# def _parse_num_and_value(expression, target):
# def parse_usul(usul):
# def parse_makam_form(form):
# def parse_raag(raag):
# def parse_taal(taal):
# def parse_hindustani_form(form):
# def parse_carnatic_form(form):
# def parse_laya(laya):
# def group_makam_tags(makams, forms, usuls):


# Path: test/tag_test.py
import unittest
from compmusic import tags


    def test_group_makam_tags(self):
        makams = [(0, "beyati")]
        forms = [(0, "peşrev")]
        usuls = [(0, "hafif")]

        groups = tags.group_makam_tags(makams, forms, usuls)
        self.assertEqual(1, len(groups))
        g = groups[0]
        self.assertEqual("beyati", g["makam"])
        self.assertEqual("peşrev", g["form"])
        self.assertEqual("hafif", g["usul"])

        # Test two sets of tags
        makams = [(0, "Zilkeş"), (1, "Uşşak")]
        forms = [(0, "Sirto"), (1, "Peşrev")]
        usuls = [(0, "Sofyan"), (1, "Remel")]
        groups = tags.group_makam_tags(makams, forms, usuls)
        self.assertEqual(2, len(groups))
        g = groups[0]
        self.assertEqual("Zilkeş", g["makam"])
        g = groups[1]
        self.assertEqual("Uşşak", g["makam"])
        self.assertEqual("Peşrev", g["form"])
        self.assertEqual("Remel", g["usul"])

        # Missing a tag on the last number
        makams = [(0, "Zilkeş")]
        forms = [(0, "Sirto"), (1, "Peşrev")]
        usuls = [(0, "Sofyan"), (1, "Remel")]

        groups = tags.group_makam_tags(makams, forms, usuls)