Esempio n. 1
0
def test_files2stream(unsorted_file, unsorted_file_values):

    infiles = [unsorted_file, unsorted_file, unsorted_file]

    srt = tinysort.files2stream(*infiles, reader=tinysort.io.Pickle())

    expected = sorted(it.chain(
        unsorted_file_values, unsorted_file_values, unsorted_file_values))
    assert len(expected) == 3 * len(unsorted_file_values)

    assert expected == list(srt)
Esempio n. 2
0
def test_sort_files(unsorted_files):
    paths, slz = unsorted_files
    result = list(tinysort.files2stream(*paths, reader=slz, key=lambda x: x[0]))
    print(result)
    assert result == [(i, i) for i in range(10)]