File: test_tlz.py

package info (click to toggle)
python-cytoolz 1.0.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 588 kB
  • sloc: python: 3,913; makefile: 34
file content (54 lines) | stat: -rw-r--r-- 1,486 bytes parent folder | download | duplicates (5)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import toolz


def test_tlz():
    import tlz
    tlz.curry
    tlz.functoolz.curry
    assert tlz.__package__ == 'tlz'
    assert tlz.__name__ == 'tlz'
    import tlz.curried
    assert tlz.curried.__package__ == 'tlz.curried'
    assert tlz.curried.__name__ == 'tlz.curried'
    tlz.curried.curry
    import tlz.curried.operator
    assert tlz.curried.operator.__package__ in (None, 'tlz.curried')
    assert tlz.curried.operator.__name__ == 'tlz.curried.operator'
    assert tlz.functoolz.__name__ == 'tlz.functoolz'
    m1 = tlz.functoolz
    import tlz.functoolz as m2
    assert m1 is m2
    import tlz.sandbox
    try:
        import tlzthisisabadname.curried
        1/0
    except ImportError:
        pass
    try:
        import tlz.curry
        1/0
    except ImportError:
        pass
    try:
        import tlz.badsubmodulename
        1/0
    except ImportError:
        pass

    assert toolz.__package__ == 'toolz'
    assert toolz.curried.__package__ == 'toolz.curried'
    assert toolz.functoolz.__name__ == 'toolz.functoolz'

    import cytoolz
    assert cytoolz.__package__ == 'cytoolz'
    assert cytoolz.curried.__package__ == 'cytoolz.curried'
    assert cytoolz.functoolz.__name__ == 'cytoolz.functoolz'
    assert tlz.pluck is cytoolz.pluck

    assert tlz.__file__ == toolz.__file__
    assert tlz.functoolz.__file__ == toolz.functoolz.__file__

    assert tlz.pipe is toolz.pipe

    assert 'tlz' in tlz.__doc__
    assert tlz.curried.__doc__ is not None