Coverage for src/tests/test_any_pass.py: 100%

1 from collections.abc import Callable

2

3 import remedapy as R

4

5

6 def is_divisible_by(n: int) -> Callable[[int], bool]:

7 return lambda x: x % n == 0

8

9

10 fns = [is_divisible_by(3), is_divisible_by(4)]

11

12

13 class TestAnyPass:

14 def test_data_first(self):

15 # R.any_pass(data, fns);

16 assert R.any_pass(12, fns)

17 assert not R.any_pass(10, fns)

18

19 def test_data_last(self):

20 # R.any_pass(fns)(data);

21 assert R.any_pass(fns)(12)

22 assert not R.any_pass(fns)(10)