dateutil / dateutil

Compare b698800 ... +0 ... 390113a


@@ -4917,3 +4917,19 @@
Loading
4917 4917
        rule = "FREQ=YEARLY;WKST=MO;UNTIL=2019-03-29T00:59:59+01:00"
4918 4918
        with self.assertRaises(ValueError, msg="unsupported rule: " + rule):
4919 4919
            rrulestr(rule, dtstart=datetime(1997, 9, 2, 9, 0))
4920 +
4921 +
    def testUnsupportedRuleErrorWhenTimeFormatIsNotCorrect(self):
4922 +
        rule = "FREQ=YEARLY;WKST=MO;UNTIL=2019-03-29T00:59:59+01:00"
4923 +
        with pytest.raises(ValueError) as exception:
4924 +
            rrulestr(rule, dtstart=datetime(1997, 9, 2, 9, 0))
4925 +
        self.assertEqual("Unsupported rule: " + rule + ". Check if property is supported and time format does not have "
4926 +
                                                       "delimiters according to RFC5545",
4927 +
                         str(exception.value))
4928 +
4929 +
    def testUnsupportedRuleErrorWhenRuleNameIsNotCorrect(self):
4930 +
        rule = "XYZ:19970902T090000"
4931 +
        with pytest.raises(ValueError) as exception:
4932 +
            rrulestr(rule, dtstart=datetime(1997, 9, 2, 9, 0))
4933 +
        self.assertEqual("Unsupported rule: " + rule + ". Check if property is supported and time format does not have "
4934 +
                                                       "delimiters according to RFC5545",
4935 +
                         str(exception.value))

@@ -1697,7 +1697,9 @@
Loading
1697 1697
                                         value)
1698 1698
                    dtstart = dtvals[0]
1699 1699
                else:
1700 -
                    raise ValueError("unsupported rule: "+s)
1700 +
                    raise ValueError("Unsupported rule: " + s + ". Check if property is supported and time "
1701 +
                                                                "format does not have delimiters "
1702 +
                                                                "according to RFC5545")
1701 1703
            if (forceset or len(rrulevals) > 1 or rdatevals
1702 1704
                    or exrulevals or exdatevals):
1703 1705
                if not parser and (rdatevals or exdatevals):

Learn more Showing 20 files with coverage changes found.

Changes in dateutil/test/_common.py
-6
+4
Loading file...
Changes in dateutil/test/test_tz.py
-72
+38
Loading file...
Changes in dateutil/tz/win.py
-4
+2
Loading file...
Changes in dateutil/test/test_parser.py
-24
Loading file...
Changes in dateutil/tz/tz.py
-9
+1
Loading file...
Changes in dateutil/parser/_parser.py
-7
Loading file...
Changes in dateutil/rrule.py
-5
Loading file...
Changes in dateutil/test/test_rrule.py
-2
Loading file...
Changes in dateutil/test/test_easter.py
-3
Loading file...
Changes in dateutil/test/test_isoparser.py
-27
Loading file...
Changes in dateutil/test/test_internals.py
-3
Loading file...
Changes in dateutil/test/test_import_star.py
-1
Loading file...
Changes in dateutil/parser/isoparser.py
-4
Loading file...
Changes in dateutil/relativedelta.py
-2
Loading file...
Changes in dateutil/parser/__init__.py
-1
Loading file...
Changes in dateutil/test/property/test_tz_prop.py
-1
Loading file...
Changes in dateutil/test/test_utils.py
-3
Loading file...
Changes in dateutil/test/property/test_isoparse_prop.py
-1
Loading file...
Changes in dateutil/test/property/test_parser_prop.py
-2
Loading file...
Changes in dateutil/tz/_common.py
-4
-2
Loading file...
Files Coverage
dateutil -0.63% 95.32%
Project Totals (32 files) 95.32%
Loading