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

12 statements  

« prev     ^ index     » next       coverage.py v7.13.2, created at 2026-02-02 10:52 +0100

1from collections.abc import Callable 

2 

3import remedapy as R 

4 

5 

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

7 return lambda x: x % n == 0 

8 

9 

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

11 

12 

13class 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)