コード例 #1
0
def test_items():
    a = TimeSeries([1, 1.5, 2, 2.5, 10, 11], [0, 2, -1, 0.5, 0, 0]) 
    test = a.items()

    assert test == [(1.0, 0.0), (1.5, 2.0), (2.0, -1.0), (2.5, 0.5), (10.0, 0.0), (11.0, 0.0)]
コード例 #2
0
def test_items():
    a = TimeSeries([1, 1.5, 2, 2.5, 10, 11], [0, 2, -1, 0.5, 0, 0])
    test = a.items()

    assert test == [(1.0, 0.0), (1.5, 2.0), (2.0, -1.0), (2.5, 0.5),
                    (10.0, 0.0), (11.0, 0.0)]
コード例 #3
0
def test_pair():
    ts = TimeSeries(range(0, 7))
    assert ts.items() == [(1, 0), (2, 1), (3, 2), (4, 3), (5, 4), (6, 5),
                          (7, 6)]
コード例 #4
0
ファイル: test_ts.py プロジェクト: glacierscse/cs207project
def test_items():
    data = [0, 1, 2, 3, 4]  #range(0,5)
    time = [5, 6, 7, 8, 9]  #range(5,10)
    ts = TimeSeries(data, time)
    assert ts.items() == [(5, 0), (6, 1), (7, 2), (8, 3), (9, 4)]