Beispiel #1
0
def test_parse_date_2_digit_year_last_century():
    """Test the ability to parse a str to produce a pandas datetime
    pre-2000"""

    date = pytime.parse_date('94', '10', '31', century=1900)

    assert date == pds.datetime(1994, 10, 31)
Beispiel #2
0
def test_parse_date_bad_input():
    """Test the ability to idenitfy a non-physical date"""

    date = pytime.parse_date('194', '15', '31')
Beispiel #3
0
def test_parse_date_4_digit_year():
    """Test the ability to parse a str to produce a pandas datetime"""

    date = pytime.parse_date('1994', '10', '31')

    assert date == pds.datetime(1994, 10, 31)
Beispiel #4
0
    def test_parse_date_bad_input(self):
        """Test the ability to identify a non-physical date"""

        with pytest.raises(ValueError):
            _ = pytime.parse_date('194', '15', '31')
Beispiel #5
0
    def test_parse_date_2_digit_year(self):
        """Test the ability to parse a str to produce a pandas datetime"""

        date = pytime.parse_date('14', '10', '31')

        assert date == dt.datetime(2014, 10, 31)