コード例 #1
0
ファイル: zip_obj_test.py プロジェクト: slavaGanzin/pyramda
def take_curry_test():
    assert_iterables_equal(
        zip_obj(['a', 'b', 'c'])([1, 2, 3]), {
            'a': 1,
            'b': 2,
            'c': 3
        })
コード例 #2
0
def test_take_curry():
    assert_iterables_equal(
        zip_obj(["a", "b", "c"])([1, 2, 3]), {
            "a": 1,
            "b": 2,
            "c": 3
        })
コード例 #3
0
ファイル: test_append.py プロジェクト: slavaGanzin/ramda.py
def test_append_curry():
    assert_iterables_equal(append(3)([1, 2]), [1, 2, 3])
コード例 #4
0
ファイル: test_drop.py プロジェクト: slavaGanzin/ramda.py
def test_drop_curry():
    assert_iterables_equal(drop(2)([1, 2, 3, 4]), [3, 4])
コード例 #5
0
def values_test():
    assert_iterables_equal(set(values(test_dict)), set([1, 3, 2]))
コード例 #6
0
def cons_nocurry_test():
    assert_iterables_equal(adjust(add_one, 1, [2, 3]), [2, 4])
コード例 #7
0
def uniq_nocurry_test():
    assert_iterables_equal(uniq([1, 2, 3, 3, 4]), [1, 2, 3, 4])
コード例 #8
0
def values_test():
    assert_iterables_equal(values(test_dict), [1, 2, 3])
コード例 #9
0
def aperture_curry_test():
    assert_iterables_equal(aperture(2)([1, 2, 3, 4, 5]), [[1, 2], [3, 4], [5]])
コード例 #10
0
def test_uniq_nocurry():
    assert_iterables_equal(times(identity, 5), [0, 1, 2, 3, 4])
    assert_iterables_equal(times(identity)(5), [0, 1, 2, 3, 4])
コード例 #11
0
ファイル: update_test.py プロジェクト: zequequiel/ramda.py
def cons_curry_test():
    assert_iterables_equal(update(1, 1)([2, 3]), [2, 1])
コード例 #12
0
ファイル: test_zip_with.py プロジェクト: slavaGanzin/ramda.py
def test_uniq_nocurry():
    assert_iterables_equal(zip_with(add, [1, 1, 1], [1, 2, 3]), [2, 3, 4])
コード例 #13
0
def cons_curry_test():
    assert_iterables_equal(cons(1)([2, 3]), [1, 2, 3])
コード例 #14
0
ファイル: test_zip_with.py プロジェクト: slavaGanzin/ramda.py
def test_take_curry():
    assert_iterables_equal(zip_with(add)([1, 1, 1], [1, 2, 3]), [2, 3, 4])
コード例 #15
0
ファイル: test_update.py プロジェクト: slavaGanzin/ramda.py
def test_cons_nocurry():
    assert_iterables_equal(update(1, 1, [2, 3]), [2, 1])
    assert_iterables_equal(update(-1, "_", ["a", "b", "c"]), ["a", "b", "_"])
コード例 #16
0
ファイル: chain_test.py プロジェクト: zequequiel/ramda.py
def chain_curry_test():
    assert_iterables_equal(chain(to_two)([1, 2, 3]), [1, 1, 2, 2, 3, 3])
コード例 #17
0
def test_chain_nocurry():
    assert_iterables_equal(chain(to_two, [1, 2, 3]), [1, 1, 2, 2, 3, 3])
コード例 #18
0
def test_cons_curry():
    assert_iterables_equal(cons(1)([2, 3]), [1, 2, 3])
コード例 #19
0
def drop_curry_test():
    assert_iterables_equal(drop(2)([1, 2, 3, 4]), [3, 4])
コード例 #20
0
ファイル: xprod_test.py プロジェクト: slavaGanzin/pyramda
def uniq_nocurry_test():
    assert_iterables_equal(xprod([1, 2], ['a', 'b']), [
                           [1, 'a'], [2, 'a'], [1, 'b'], [2, 'b']])
コード例 #21
0
def aperture_curry_test():
    assert_iterables_equal(aperture(10)([1, 2, 3, 4, 5]), [])
コード例 #22
0
ファイル: test_xprod.py プロジェクト: slavaGanzin/ramda.py
def test_uniq_nocurry():
    assert_iterables_equal(xprod([1, 2], ["a", "b"]),
                           [[1, "a"], [2, "a"], [1, "b"], [2, "b"]])
コード例 #23
0
def test_uniq_nocurry():
    assert_iterables_equal(uniq([1, 2, 3, 3, 4]), [1, 2, 3, 4])
コード例 #24
0
ファイル: map_test.py プロジェクト: slavaGanzin/pyramda
def map_nocurry_test():
    assert_iterables_equal(map(add1, [1, 2, 3]), [2, 3, 4])
コード例 #25
0
ファイル: xprod_test.py プロジェクト: slavaGanzin/pyramda
def take_curry_test():
    assert_iterables_equal(xprod([1, 2])(['a', 'b']), [
                           [1, 'a'], [2, 'a'], [1, 'b'], [2, 'b']])
コード例 #26
0
ファイル: zip_obj_test.py プロジェクト: slavaGanzin/pyramda
def uniq_nocurry_test():
    assert_iterables_equal(zip_obj(['a', 'b', 'c'], [1, 2, 3]), {
        'a': 1,
        'b': 2,
        'c': 3
    })
コード例 #27
0
ファイル: test_xprod.py プロジェクト: slavaGanzin/ramda.py
def test_take_curry():
    assert_iterables_equal(
        xprod([1, 2])(["a", "b"]), [[1, "a"], [2, "a"], [1, "b"], [2, "b"]])
コード例 #28
0
def test_uniq_nocurry():
    assert_iterables_equal(zip_obj(["a", "b", "c"], [1, 2, 3]), {
        "a": 1,
        "b": 2,
        "c": 3
    })
コード例 #29
0
ファイル: times_test.py プロジェクト: zequequiel/ramda.py
def uniq_nocurry_test():
    assert_iterables_equal(times(5), [1, 2, 3, 4])
コード例 #30
0
ファイル: drop_last_test.py プロジェクト: slavaGanzin/pyramda
def drop_nocurry_test():
    assert_iterables_equal(drop_last(2, [1, 2, 3, 4]), [1, 2])