Exemple #1
0
    def test_first(self):
        res = rfc3339_to_datetime('1985-04-12T23:20:50.52')
        assert res.hour == 23, res.hour

        res = rfc3339_to_datetime('1985-04-12T23:20:50.52')
        assert res.hour == 23

        with self.assertRaises(ValueError):
            res = rfc3339_to_datetime('foobar')
            assert res.hour == 23
Exemple #2
0
def test_first():
    res = rfc3339_to_datetime('1985-04-12T23:20:50.52')
    assert res.hour == 23, res.hour

    res = rfc3339_to_datetime('1985-04-12T23:20:50.52')
    assert res.hour == 23

    with pytest.raises(ValueError):
        res = rfc3339_to_datetime('foobar')
        assert res.hour == 23
Exemple #3
0
def test_rfc3339():
    res = rfc3339_to_datetime('1985-04-12T23:20:50.52')
    assert res.hour == 23, res.hour

    res = rfc3339_to_datetime('1985-04-12T23:20:50.52')
    assert res.hour == 23

    with pytest.raises(ValueError):
        res = rfc3339_to_datetime('foobar')
        assert res.hour == 23

    res = rfc3339_to_datetime('1985-04-12')
    assert res.day == 12

    res = rfc3339_to_datetime('1985-04-12T23:20:50.52Z')
    assert res.hour == 23

    res = rfc3339_to_datetime('1985-04-12T23:20:50.52Z+20')
    assert res.hour == 23