# Path: cjktools/scripts.py
# class Script(Enum):
# class ScriptMapping:
#     def __init__(self, from_script, to_script):
#     def __call__(self, j_string):
# def normalize_ascii(j_string):
# def normalize_kana(j_string):
# def normalize(j_string):
# def get_script(script):
# def compare_kana(j_string_a, j_string_b):
# def contains_script(script, j_string):
# def script_type(char):
# def script_boundaries(j_string):
# def script_types(j_string):
# def unique_kanji(j_string):
# 
# Path: cjktools/scripts.py
# class Script(Enum):
#     Hiragana = 1
#     Katakana = 2
#     Kanji = 3
#     Ascii = 4
#     FullAscii = 5
#     HalfKatakana = 6
#     Unknown = 7


import unittest
from cjktools import scripts
from cjktools.scripts import Script

def suite():
    test_suite = unittest.TestSuite((
        unittest.makeSuite(ScriptsTestCase),
    ))
    return test_suite


class ScriptsTestCase(unittest.TestCase):
    """This class tests script detection and invariance."""
    def setUp(self):
        self.test_script = 'AＡあア亜'
        pass

    def test_fetch_scripts(self):
        """
        Test fetching of hiragana and katakana, and converting between them.
        """
        hiragana = 'ぁあぃいぅうぇえぉおかがきぎくぐけげこごさざしじすずせぜそぞただちぢっつづてでとどなにぬねのはばぱひびぴふぶぷへべぺほぼぽまみむめもゃやゅゆょよらりるれろゎわゐゑをんゔゕゖ'  # nopep8
        self.assertEqual(scripts.get_script(Script.Hiragana), hiragana)
        katakana = 'ァアィイゥウェエォオカガキギクグケゲコゴサザシジスズセゼソゾタダチヂッツヅテデトドナニヌネノハバパヒビピフブプヘベペホボポマミムメモャヤュユョヨラリルレロヮワヰヱヲンヴヵヶ'  # nopep8
        self.assertEqual(scripts.get_script(Script.Katakana), katakana)

        self.assertEqual(scripts.to_hiragana(katakana), hiragana)
        self.assertEqual(scripts.to_katakana(hiragana), katakana)

    def test_script_type(self):
        """ Tests the script_type() method.
        """
        script_type = scripts.script_type

# Path: cjktools/scripts.py
# class Script(Enum):
# class ScriptMapping:
#     def __init__(self, from_script, to_script):
#     def __call__(self, j_string):
# def normalize_ascii(j_string):
# def normalize_kana(j_string):
# def normalize(j_string):
# def get_script(script):
# def compare_kana(j_string_a, j_string_b):
# def contains_script(script, j_string):
# def script_type(char):
# def script_boundaries(j_string):
# def script_types(j_string):
# def unique_kanji(j_string):
# 
# Path: cjktools/scripts.py
# class Script(Enum):
#     Hiragana = 1
#     Katakana = 2
#     Kanji = 3
#     Ascii = 4
#     FullAscii = 5
#     HalfKatakana = 6
#     Unknown = 7


# Path: cjktools/tests/test_scripts.py
import unittest
from cjktools import scripts
from cjktools.scripts import Script


def suite():
    test_suite = unittest.TestSuite((
        unittest.makeSuite(ScriptsTestCase),
    ))
    return test_suite


class ScriptsTestCase(unittest.TestCase):
    """This class tests script detection and invariance."""
    def setUp(self):
        self.test_script = 'AＡあア亜'
        pass

    def test_fetch_scripts(self):
        """
        Test fetching of hiragana and katakana, and converting between them.
        """
        hiragana = 'ぁあぃいぅうぇえぉおかがきぎくぐけげこごさざしじすずせぜそぞただちぢっつづてでとどなにぬねのはばぱひびぴふぶぷへべぺほぼぽまみむめもゃやゅゆょよらりるれろゎわゐゑをんゔゕゖ'  # nopep8
        self.assertEqual(scripts.get_script(Script.Hiragana), hiragana)
        katakana = 'ァアィイゥウェエォオカガキギクグケゲコゴサザシジスズセゼソゾタダチヂッツヅテデトドナニヌネノハバパヒビピフブプヘベペホボポマミムメモャヤュユョヨラリルレロヮワヰヱヲンヴヵヶ'  # nopep8
        self.assertEqual(scripts.get_script(Script.Katakana), katakana)

        self.assertEqual(scripts.to_hiragana(katakana), hiragana)
        self.assertEqual(scripts.to_katakana(hiragana), katakana)

    def test_script_type(self):
        """ Tests the script_type() method.
        """
        script_type = scripts.script_type

        self.assertEqual(script_type(self.test_script), Script.Ascii)