Beispiel #1
0
def test_series_point_generator():
    with open(os.getcwd() + '/features/anscombe.txt') as source:
        data = tuple(csv_row_trim_iterator(csv_row_iterator(source)))
        
        series_0 = tuple(series_point_generator(0, data))
        assert(len(series_0) == 11)
        assert(len(series_0[0]) == 2)
        
        series_1 = tuple(series_point_generator(1, data))
        assert(len(series_1) == 11)
        assert(len(series_1[0]) == 2)
        
        series_2 = tuple(series_point_generator(2, data))
        assert(len(series_2) == 11)
        assert(len(series_2[0]) == 2)
        
        series_3 = tuple(series_point_generator(3, data))
        assert(len(series_3) == 11)
        assert(len(series_3[0]) == 2)
Beispiel #2
0
def test_csv_head_trimmer():
    with open(os.getcwd() + '/features/anscombe.txt') as source:
        rows = tuple(csv_row_trim_iterator(csv_row_iterator(source, '\t')))
        assert(len(rows) == 11)