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

1 import remedapy as R

2

3

4 class TestAdd:

5 def test_data_first(self):

6 # R.default_to(data, fallback);

7 assert R.default_to('hello', 'world') == 'hello'

8 assert R.default_to(None, 'world') == 'world'

9

10 def test_data_last(self):

11 # R.default_to(fallback)(data);

12

13 assert R.pipe('hello', R.default_to('world')) == 'hello'

14 assert R.pipe(None, R.default_to('world')) == 'world'