# Path: css2video/constants.py
# class ValueType(object):
#     """Class to define constants for value types"""
# 
#     number = 'number'
#     length = 'length'
#     percentage = 'percentage'
#     time = 'time'
#     color = 'color'
#     text = 'text'
#     url = 'url'
#     function = 'function'
#     array = 'array'
# 
# Path: css2video/parsers/value.py
# class Array(BaseParser):
#     """Parse an array value. The array item values can be of any type"""
# 
#     ParseException = ArrayParseException
# 
#     @classmethod
#     def grammar(cls):
#         """Grammar to parse an array value"""
#         array_types = [
#             Number, Length, Percentage, Time, Color, Text, Url, Function]
#         array_parser = array_types[0].parser()
#         for array_type in array_types[1:]:
#             array_parser ^= array_type.parser()
#         return array_parser + pp.OneOrMore(array_parser)
# 
#     @classmethod
#     def parse_action(cls, tokens):
#         """Returns a dictionary from the parsed tokens"""
#         return {
#             'type': ValueType.array,
#             'values': [value for value in tokens]
#         }
# 
# class ArrayParseException(Exception):
#     """Raised when there is an exception while parsing an array value"""
#     pass


import unittest
from css2video.constants import ValueType
from css2video.parsers.value import Array, ArrayParseException



class TestCase(unittest.TestCase):

    def test_parser(self):
        response = Array.parse('20px rgba(0, 0, 0, 1)')
        self.assertEqual(
            response,
            dict(type=ValueType.array, values=[

# Path: css2video/constants.py
# class ValueType(object):
#     """Class to define constants for value types"""
# 
#     number = 'number'
#     length = 'length'
#     percentage = 'percentage'
#     time = 'time'
#     color = 'color'
#     text = 'text'
#     url = 'url'
#     function = 'function'
#     array = 'array'
# 
# Path: css2video/parsers/value.py
# class Array(BaseParser):
#     """Parse an array value. The array item values can be of any type"""
# 
#     ParseException = ArrayParseException
# 
#     @classmethod
#     def grammar(cls):
#         """Grammar to parse an array value"""
#         array_types = [
#             Number, Length, Percentage, Time, Color, Text, Url, Function]
#         array_parser = array_types[0].parser()
#         for array_type in array_types[1:]:
#             array_parser ^= array_type.parser()
#         return array_parser + pp.OneOrMore(array_parser)
# 
#     @classmethod
#     def parse_action(cls, tokens):
#         """Returns a dictionary from the parsed tokens"""
#         return {
#             'type': ValueType.array,
#             'values': [value for value in tokens]
#         }
# 
# class ArrayParseException(Exception):
#     """Raised when there is an exception while parsing an array value"""
#     pass


# Path: tests/parsers/value/test_array.py
import unittest
from css2video.constants import ValueType
from css2video.parsers.value import Array, ArrayParseException




class TestCase(unittest.TestCase):

    def test_parser(self):
        response = Array.parse('20px rgba(0, 0, 0, 1)')
        self.assertEqual(
            response,
            dict(type=ValueType.array, values=[

                dict(type=ValueType.length, value=20., unit='px'),