Example #1
0
def test_TimeDelta_string(tdsp):
    string, total_seconds = tdsp
    td = TimeDelta(string)
    print(string, td)
    assert td.total_seconds() == total_seconds
    assert td.to_string() == string
Example #2
0
def test_TimeDelta_days():
    td = TimeDelta("00:00:86400")
    assert td.to_string() == "1d+00:00:00"
Example #3
0
def test_TimeDelta_nomicro():
    td = TimeDelta("10d+1:2:3.0")
    assert td.to_string() == "10d+01:02:03"
Example #4
0
def test_TimeDelta_negday():
    td = TimeDelta("-1d+1:2:3.4")
    assert td.to_string() == "-1d+01:02:03.000004"
Example #5
0
def test_TimeDelta_noday():
    td = TimeDelta("0d+1:2:3.4")
    assert td.to_string() == "01:02:03.000004"
Example #6
0
def test_TimeDelta_default():
    td = TimeDelta()
    td.to_string()
    assert td.total_seconds() == 0.0