# Path: WeCron/wxhook/todo_parser/local_parser.py
# CN_NUM = {
#         u'〇': 0,
#         u'一': 1,
#         u'二': 2,
#         u'三': 3,
#         u'四': 4,
#         u'五': 5,
#         u'六': 6,
#         u'七': 7,
#         u'八': 8,
#         u'九': 9,
#          
#         u'零': 0,
#         u'壹': 1,
#         u'贰': 2,
#         u'叁': 3,
#         u'肆': 4,
#         u'伍': 5,
#         u'陆': 6,
#         u'柒': 7,
#         u'捌': 8,
#         u'玖': 9,
#          
#         u'貮': 2,
#         u'两': 2,
#     }
# CN_UNIT = {
#         u'十': 10,
#         u'拾': 10,
#         u'百': 100,
#         u'佰': 100,
#         u'千': 1000,
#         u'仟': 1000,
#         u'万': 10000,
#         u'萬': 10000,
#         u'亿': 100000000,
#         u'億': 100000000,
#         u'兆': 1000000000000,
#     }
# DEFAULT_HOUR = 8
# DEFAULT_MINUTE = 0
# def parse_cn_number(cn_sentence):
#     def __init__(self):
#     def parse_by_rules(self, text):
#     def consume_repeat(self):
#     def consume_year(self):
#     def consume_month(self):
#     def consume_day(self):
#     def consume_hour(self):
#     def consume_minute(self):
#     def consume_second(self):
#     def exclude_time_range(self, next_expectation):
#     def consume_year_period(self):
#     def consume_month_period(self):
#     def consume_day_period(self):
#     def consume_weekday_period(self):
#     def consume_hour_period(self):
#     def consume_minute_period(self):
#     def consume_second_period(self):
#     def consume_to_end(self):
#     def consume_word(self, *words):
#     def consume_phrase(self, *words):
#     def consume_digit(self, consume=True):
#     def current_word(self):
#     def current_tag(self):
#     def peek_next_word(self, step=1):
#     def get_index(self):
#     def set_index(self, idx):
#     def has_next(self):
#     def advance(self, step=1):
# class LocalParser(object):


import unittest
from dateutil.relativedelta import relativedelta
from django.utils import timezone
from django.test import TestCase
from ..todo_parser.local_parser import LocalParser, parse_cn_number, DEFAULT_HOUR, ParseError
from remind.models import remind
# coding: utf-8
from __future__ import unicode_literals, absolute_import



class LocalParserTestCase(TestCase):

    def setUp(self):
        self.now = timezone.localtime(timezone.now())
        self.parser = LocalParser()
        self.parse = self.parser.parse_by_rules

    def test_cn_parser(self):
        test_dig = [u'九',
                    u'十一',
                    u'一百二十三',
                    u'一千二百零三',
                    u'一万一千一百零一',
                    u'99八十一'
                    ]

        result_dig = []
        for cn in test_dig:

# Path: WeCron/wxhook/todo_parser/local_parser.py
# CN_NUM = {
#         u'〇': 0,
#         u'一': 1,
#         u'二': 2,
#         u'三': 3,
#         u'四': 4,
#         u'五': 5,
#         u'六': 6,
#         u'七': 7,
#         u'八': 8,
#         u'九': 9,
#          
#         u'零': 0,
#         u'壹': 1,
#         u'贰': 2,
#         u'叁': 3,
#         u'肆': 4,
#         u'伍': 5,
#         u'陆': 6,
#         u'柒': 7,
#         u'捌': 8,
#         u'玖': 9,
#          
#         u'貮': 2,
#         u'两': 2,
#     }
# CN_UNIT = {
#         u'十': 10,
#         u'拾': 10,
#         u'百': 100,
#         u'佰': 100,
#         u'千': 1000,
#         u'仟': 1000,
#         u'万': 10000,
#         u'萬': 10000,
#         u'亿': 100000000,
#         u'億': 100000000,
#         u'兆': 1000000000000,
#     }
# DEFAULT_HOUR = 8
# DEFAULT_MINUTE = 0
# def parse_cn_number(cn_sentence):
#     def __init__(self):
#     def parse_by_rules(self, text):
#     def consume_repeat(self):
#     def consume_year(self):
#     def consume_month(self):
#     def consume_day(self):
#     def consume_hour(self):
#     def consume_minute(self):
#     def consume_second(self):
#     def exclude_time_range(self, next_expectation):
#     def consume_year_period(self):
#     def consume_month_period(self):
#     def consume_day_period(self):
#     def consume_weekday_period(self):
#     def consume_hour_period(self):
#     def consume_minute_period(self):
#     def consume_second_period(self):
#     def consume_to_end(self):
#     def consume_word(self, *words):
#     def consume_phrase(self, *words):
#     def consume_digit(self, consume=True):
#     def current_word(self):
#     def current_tag(self):
#     def peek_next_word(self, step=1):
#     def get_index(self):
#     def set_index(self, idx):
#     def has_next(self):
#     def advance(self, step=1):
# class LocalParser(object):


# Path: WeCron/wxhook/tests/test_todo_parser.py
import unittest
from dateutil.relativedelta import relativedelta
from django.utils import timezone
from django.test import TestCase
from ..todo_parser.local_parser import LocalParser, parse_cn_number, DEFAULT_HOUR, ParseError
from remind.models import remind

# coding: utf-8
from __future__ import unicode_literals, absolute_import



class LocalParserTestCase(TestCase):

    def setUp(self):
        self.now = timezone.localtime(timezone.now())
        self.parser = LocalParser()
        self.parse = self.parser.parse_by_rules

    def test_cn_parser(self):
        test_dig = [u'九',
                    u'十一',
                    u'一百二十三',
                    u'一千二百零三',
                    u'一万一千一百零一',
                    u'99八十一'
                    ]

        result_dig = []
        for cn in test_dig:

            result_dig.append(parse_cn_number(cn))