Example #1
0
def test_rfc1123_to_Epoch_good():
    try:
        t = rfc1123_to_Epoch("Wed, 22 Oct 2008 10:52:40 GMT")
        assert True
        assert isinstance(t, (int, float))
    except:
        assert False
Example #2
0
def test_Epoch_to_rfc1123():
    given = "Wed, 22 Oct 2008 10:52:40 GMT"
    t = rfc1123_to_Epoch(given)
    print t
    s = Epoch_to_rfc1123(t)
    assert isinstance(s, (str))
    print repr(s)
    print repr(given)
    assert s == given
Example #3
0
def test_rfc1123_to_Epoch_bad():
    try:
        t = rfc1123_to_Epoch("10:52:40 GMT")
        assert False
    except ValueError:
        assert True
Example #4
0
def test_rfc1123_to_Epoch_bad_TZ():
    try:
        t = rfc1123_to_Epoch("Wed, 22 Oct 2008 10:52:40 +0900")
        assert False
    except ValueError:
        assert True