예제 #1
0
    def test_last_month_regex(self):
        month_regex = _month_regex_before('2016', '12')
        month_regex = '^' + month_regex + '$'

        for month in range(2, 12):
            self.assertRegexpMatches('2016-%.2d-31' % month, month_regex)

        self.assertNotRegexpMatches('2016-12-01', month_regex)
예제 #2
0
    def test_last_month_regex(self):
        month_regex = _month_regex_before('2016', '12')
        month_regex = '^' + month_regex + '$'

        for month in range(2, 12):
            self.assertRegexpMatches('2016-%.2d-31' % month, month_regex)

        self.assertNotRegexpMatches('2016-12-01', month_regex)
예제 #3
0
    def test_feb_month_regex(self):
        month_regex = _month_regex_before('2016', '02')
        month_regex = '^' + month_regex + '$'

        self.assertRegexpMatches('2016-01-01', month_regex)
        self.assertRegexpMatches('2016-01-31', month_regex)

        for month in range(2, 13):
            self.assertNotRegexpMatches('2016-%.2d-31' % month, month_regex)
예제 #4
0
    def test_feb_month_regex(self):
        month_regex = _month_regex_before('2016', '02')
        month_regex = '^' + month_regex + '$'

        self.assertRegexpMatches('2016-01-01', month_regex)
        self.assertRegexpMatches('2016-01-31', month_regex)

        for month in range(2, 13):
            self.assertNotRegexpMatches('2016-%.2d-31' % month, month_regex)
예제 #5
0
    def test_extensive_month_regex(self):
        for test_month in range(2, 13):
            month_regex = _month_regex_before('2016', '%.2d' % test_month)
            month_regex = '^' + month_regex + '$'

            for month in range(1, test_month):
                self.assertRegexpMatches('2016-%.2d-31' % month, month_regex)

            for month in range(test_month, 13):
                self.assertNotRegexpMatches('2016-%.2d-01' % month,
                                            month_regex)
예제 #6
0
    def test_extensive_month_regex(self):
        for test_month in range(2,13):
            month_regex = _month_regex_before('2016', '%.2d' % test_month)
            month_regex = '^' + month_regex + '$'


            for month in range(1, test_month):
                self.assertRegexpMatches('2016-%.2d-31' % month, month_regex)

            for month in range(test_month, 13):
                self.assertNotRegexpMatches('2016-%.2d-01' % month, month_regex)
예제 #7
0
 def test_min_month_regex(self):
     month_regex = _month_regex_before('2016', '01')
     self.assertIsNone(month_regex)
예제 #8
0
 def test_min_month_regex(self):
     month_regex = _month_regex_before('2016', '01')
     self.assertIsNone(month_regex)