# Path: pydsl/grammar/definition.py
# class String(Grammar, str):
#     def __init__(self, string):
#         if isinstance(string, list):
#             raise TypeError('Attempted to initialize a String with a list %s' % (string, ) )
#         Grammar.__init__(self, None)
# 
#     @property
#     def first(self):
#         return String(self[0])
# 
#     def enum(self):
#         yield self
# 
#     @property
#     def maxsize(self):
#         return len(self)
# 
#     @property
#     def minsize(self):
#         return len(self)
# 
#     @property
#     def alphabet(self):
#         from pydsl.encoding import ascii_encoding
#         return ascii_encoding
# 
# Path: pydsl/encoding.py



import unittest
        import plye
from pydsl.grammar.definition import String
from pydsl.encoding import ascii_encoding
        from pydsl.grammar.definition import PLYGrammar
        from pydsl.grammar.definition import JsonSchema
    def setUp(self):
        self.grammardef = PLYGrammar(plye)

    @unittest.skip
    def testEnumerate(self):
        self.grammardef.enum()

    @unittest.skip
    def testFirst(self):
        self.grammardef.first

    @unittest.skip
    def testMin(self):
        self.grammardef.minsize

    @unittest.skip
    def testMax(self):
        self.grammardef.maxsize

    def testAlphabet(self):
        self.assertListEqual(self.grammardef.alphabet, frozenset)

class TestGrammarDefinitionString(unittest.TestCase):
    def setUp(self):
        self.grammardef = String('abc')

    def testEnumerate(self):
        self.assertListEqual(['abc'], [x for x in self.grammardef.enum()])

    def testFirst(self):

# Path: pydsl/grammar/definition.py
# class String(Grammar, str):
#     def __init__(self, string):
#         if isinstance(string, list):
#             raise TypeError('Attempted to initialize a String with a list %s' % (string, ) )
#         Grammar.__init__(self, None)
# 
#     @property
#     def first(self):
#         return String(self[0])
# 
#     def enum(self):
#         yield self
# 
#     @property
#     def maxsize(self):
#         return len(self)
# 
#     @property
#     def minsize(self):
#         return len(self)
# 
#     @property
#     def alphabet(self):
#         from pydsl.encoding import ascii_encoding
#         return ascii_encoding
# 
# Path: pydsl/encoding.py



# Path: tests/unit/test_GrammarDefinition.py
import unittest
        import plye
from pydsl.grammar.definition import String
from pydsl.encoding import ascii_encoding
        from pydsl.grammar.definition import PLYGrammar
        from pydsl.grammar.definition import JsonSchema

    def setUp(self):
        self.grammardef = PLYGrammar(plye)

    @unittest.skip
    def testEnumerate(self):
        self.grammardef.enum()

    @unittest.skip
    def testFirst(self):
        self.grammardef.first

    @unittest.skip
    def testMin(self):
        self.grammardef.minsize

    @unittest.skip
    def testMax(self):
        self.grammardef.maxsize

    def testAlphabet(self):
        self.assertListEqual(self.grammardef.alphabet, frozenset)

class TestGrammarDefinitionString(unittest.TestCase):
    def setUp(self):
        self.grammardef = String('abc')

    def testEnumerate(self):
        self.assertListEqual(['abc'], [x for x in self.grammardef.enum()])

    def testFirst(self):

        self.assertEqual(self.grammardef.first, String('a'))