| 773 | |
| 774 | |
| 775 | class TestParseUnimplementedCases: |
| 776 | @pytest.mark.xfail |
| 777 | def test_somewhat_ambiguous_string(self): |
| 778 | # Ref: github issue #487 |
| 779 | # The parser is choosing the wrong part for hour |
| 780 | # causing datetime to raise an exception. |
| 781 | dtstr = '1237 PM BRST Mon Oct 30 2017' |
| 782 | res = parse(dtstr, tzinfo=self.tzinfos) |
| 783 | assert res == datetime(2017, 10, 30, 12, 37, tzinfo=self.tzinfos) |
| 784 | |
| 785 | @pytest.mark.xfail |
| 786 | def test_YmdH_M_S(self): |
| 787 | # found in nasdaq's ftp data |
| 788 | dstr = '1991041310:19:24' |
| 789 | expected = datetime(1991, 4, 13, 10, 19, 24) |
| 790 | res = parse(dstr) |
| 791 | assert res == expected, (res, expected) |
| 792 | |
| 793 | @pytest.mark.xfail |
| 794 | def test_first_century(self): |
| 795 | dstr = '0031 Nov 03' |
| 796 | expected = datetime(31, 11, 3) |
| 797 | res = parse(dstr) |
| 798 | assert res == expected, res |
| 799 | |
| 800 | @pytest.mark.xfail |
| 801 | def test_era_trailing_year_with_dots(self): |
| 802 | dstr = 'A.D.2001' |
| 803 | res = parse(dstr) |
| 804 | assert res.year == 2001, res |
| 805 | |
| 806 | @pytest.mark.xfail |
| 807 | def test_ad_nospace(self): |
| 808 | expected = datetime(6, 5, 19) |
| 809 | for dstr in [' 6AD May 19', ' 06AD May 19', |
| 810 | ' 006AD May 19', ' 0006AD May 19']: |
| 811 | res = parse(dstr) |
| 812 | assert res == expected, (dstr, res) |
| 813 | |
| 814 | @pytest.mark.xfail |
| 815 | def test_four_letter_day(self): |
| 816 | dstr = 'Frid Dec 30, 2016' |
| 817 | expected = datetime(2016, 12, 30) |
| 818 | res = parse(dstr) |
| 819 | assert res == expected |
| 820 | |
| 821 | @pytest.mark.xfail |
| 822 | def test_non_date_number(self): |
| 823 | dstr = '1,700' |
| 824 | with pytest.raises(ParserError): |
| 825 | parse(dstr) |
| 826 | |
| 827 | @pytest.mark.xfail |
| 828 | def test_on_era(self): |
| 829 | # This could be classified as an "eras" test, but the relevant part |
| 830 | # about this is the ` on ` |
| 831 | dstr = '2:15 PM on January 2nd 1973 A.D.' |
| 832 | expected = datetime(1973, 1, 2, 14, 15) |
nothing calls this directly
no outgoing calls
no test coverage detected