# 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 Url(BaseParser):
#     """Parse a URL value which is usually a quoted string"""
# 
#     ParseException = UrlParseException
# 
#     @classmethod
#     def grammar(cls):
#         """Grammar to parse a URL value"""
#         return pp.quotedString
# 
#     @classmethod
#     def parse_action(cls, tokens):
#         """Returns a dictionary from the parsed tokens"""
#         return {
#             'type': ValueType.url,
#             'value': tokens[0]
#         }
# 
# class UrlParseException(Exception):
#     """Raised when there is an exception while parsing an URL value"""
#     pass


import unittest
from css2video.constants import ValueType
from css2video.parsers.value import Url, UrlParseException



class TestCase(unittest.TestCase):

    def test_parser(self):
        response = Url.parse('"http://www.google.com"')
        self.assertEqual(
            response,
            dict(type=ValueType.url, value='"http://www.google.com"')
        )

        with self.assertRaises(UrlParseException):

# 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 Url(BaseParser):
#     """Parse a URL value which is usually a quoted string"""
# 
#     ParseException = UrlParseException
# 
#     @classmethod
#     def grammar(cls):
#         """Grammar to parse a URL value"""
#         return pp.quotedString
# 
#     @classmethod
#     def parse_action(cls, tokens):
#         """Returns a dictionary from the parsed tokens"""
#         return {
#             'type': ValueType.url,
#             'value': tokens[0]
#         }
# 
# class UrlParseException(Exception):
#     """Raised when there is an exception while parsing an URL value"""
#     pass


# Path: tests/parsers/value/test_url.py
import unittest
from css2video.constants import ValueType
from css2video.parsers.value import Url, UrlParseException




class TestCase(unittest.TestCase):

    def test_parser(self):
        response = Url.parse('"http://www.google.com"')
        self.assertEqual(
            response,
            dict(type=ValueType.url, value='"http://www.google.com"')
        )

        with self.assertRaises(UrlParseException):

            Url.parse('random-text')