コード例 #1
0
def test_parsers_iso8601_invalid_offset_invalid():
    date_str = "2001-01-01 12-34-56"
    msg = ("Timezone hours offset out of range "
           "in datetime string \"{s}\"".format(s=date_str))

    with pytest.raises(ValueError, match=msg):
        tslib._test_parse_iso8601(date_str)
コード例 #2
0
def test_parsers_iso8601_invalid_offset_invalid():
    date_str = "2001-01-01 12-34-56"
    msg = "Timezone hours offset out of range " 'in datetime string "{s}"'.format(
        s=date_str)

    with pytest.raises(ValueError, match=msg):
        tslib._test_parse_iso8601(date_str)
コード例 #3
0
def test_parsers_iso8601(date_str, exp):
    # see gh-12060
    #
    # Test only the ISO parser - flexibility to
    # different separators and leading zero's.
    actual = tslib._test_parse_iso8601(date_str)
    assert actual == exp
コード例 #4
0
def test_parsers_iso8601(date_str, exp):
    # see gh-12060
    #
    # Test only the ISO parser - flexibility to
    # different separators and leading zero's.
    actual = tslib._test_parse_iso8601(date_str)
    assert actual == exp
コード例 #5
0
 def test_parsers_iso8601(self, date_str, exp):
     # GH#12060
     # test only the iso parser - flexibility to different
     # separators and leadings 0s
     # Timestamp construction falls back to dateutil
     actual = tslib._test_parse_iso8601(date_str)
     assert actual == exp
コード例 #6
0
 def test_parsers_iso8601(self, date_str, exp):
     # GH#12060
     # test only the iso parser - flexibility to different
     # separators and leadings 0s
     # Timestamp construction falls back to dateutil
     actual = tslib._test_parse_iso8601(date_str)
     assert actual == exp
コード例 #7
0
def test_parsers_iso8601_invalid(date_str):
    msg = "Error parsing datetime string \"{s}\"".format(s=date_str)

    with pytest.raises(ValueError, match=msg):
        tslib._test_parse_iso8601(date_str)
コード例 #8
0
def test_parsers_iso8601_leading_space():
    # GH#25895 make sure isoparser doesn't overflow with long input
    date_str, expected = ("2013-1-1 5:30:00", datetime(2013, 1, 1, 5, 30))
    actual = tslib._test_parse_iso8601(" " * 200 + date_str)
    assert actual == expected
コード例 #9
0
def test_parsers_iso8601_invalid(date_str):
    msg = 'Error parsing datetime string "{s}"'.format(s=date_str)

    with pytest.raises(ValueError, match=msg):
        tslib._test_parse_iso8601(date_str)
コード例 #10
0
 def test_parsers_iso8601_invalid(self, date_str):
     # separators must all match - YYYYMM not valid
     with pytest.raises(ValueError):
         tslib._test_parse_iso8601(date_str)
コード例 #11
0
ファイル: test_parse_iso8601.py プロジェクト: bashtage/pandas
def test_parsers_iso8601_leading_space():
    # GH#25895 make sure isoparser doesn't overflow with long input
    date_str, expected = ("2013-1-1 5:30:00", datetime(2013, 1, 1, 5, 30))
    actual = tslib._test_parse_iso8601(' ' * 200 + date_str)
    assert actual == expected
コード例 #12
0
 def test_parsers_iso8601_invalid(self, date_str):
     # separators must all match - YYYYMM not valid
     with pytest.raises(ValueError):
         tslib._test_parse_iso8601(date_str)