Ejemplo n.º 1
0
def test_sorted_2():
    stream = Stream([3, 1, 2, 8, 5, 6])
    r = stream.sorted(reverse=True).toList()
    assert r == [8, 6, 5, 3, 2, 1]
Ejemplo n.º 2
0
def test_sorted_3():
    stream = Stream(['aa', 'bbb', 'c', 'dddd'])
    r = stream.sorted(key=len).toList()
    assert r == ['c', 'aa', 'bbb', 'dddd']
Ejemplo n.º 3
0
def test_sorted_1():
    stream = Stream([3, 1, 2, 8, 5, 6])
    r = stream.sorted().toList()
    assert r == [1, 2, 3, 5, 6, 8]