File: test_join.py

package info (click to toggle)
toolz 1.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 672 kB
  • sloc: python: 5,573; makefile: 136; sh: 2
file content (34 lines) | stat: -rw-r--r-- 640 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from toolz.curried import *

try:
    xrange
except NameError:
    xrange = range

def burn(seq):
    for item in seq:
        pass


small = [(i, str(i)) for i in range(100)] * 10
big = pipe([110]*10000, map(range), concat, list)


def test_many_to_many_large():
    burn(join(get(0), small, identity, big))


def test_one_to_one_tiny():
    A = list(range(20))
    B = A[::2] + A[1::2][::-1]

    for i in xrange(50000):
        burn(join(identity, A, identity, B))


def test_one_to_many():
    A = list(range(20))
    B = pipe([20]*1000, map(range), concat, list)

    for i in xrange(100):
        burn(join(identity, A, identity, B))