Temporary input values for tests >>> temp_input_value(option=True) 10 >>> temp_input_value(option=False) 1000 >>> temp_input_value(min_val=100, option=True) 100 >>> temp_input_value(min_val=100, max_val=50) Traceback (most recent call last): ... V
(
min_val: int = 10, max_val: int = 1000, option: bool = True
)
| 14 | |
| 15 | |
| 16 | def temp_input_value( |
| 17 | min_val: int = 10, max_val: int = 1000, option: bool = True |
| 18 | ) -> int: |
| 19 | """ |
| 20 | Temporary input values for tests |
| 21 | |
| 22 | >>> temp_input_value(option=True) |
| 23 | 10 |
| 24 | |
| 25 | >>> temp_input_value(option=False) |
| 26 | 1000 |
| 27 | |
| 28 | >>> temp_input_value(min_val=100, option=True) |
| 29 | 100 |
| 30 | |
| 31 | >>> temp_input_value(min_val=100, max_val=50) |
| 32 | Traceback (most recent call last): |
| 33 | ... |
| 34 | ValueError: Invalid value for min_val or max_val (min_value < max_value) |
| 35 | |
| 36 | >>> temp_input_value("ten","fifty",1) |
| 37 | Traceback (most recent call last): |
| 38 | ... |
| 39 | AssertionError: Invalid type of value(s) specified to function! |
| 40 | |
| 41 | >>> temp_input_value(min_val=-100, max_val=500) |
| 42 | -100 |
| 43 | |
| 44 | >>> temp_input_value(min_val=-5100, max_val=-100) |
| 45 | -5100 |
| 46 | """ |
| 47 | assert ( |
| 48 | isinstance(min_val, int) |
| 49 | and isinstance(max_val, int) |
| 50 | and isinstance(option, bool) |
| 51 | ), "Invalid type of value(s) specified to function!" |
| 52 | |
| 53 | if min_val > max_val: |
| 54 | raise ValueError("Invalid value for min_val or max_val (min_value < max_value)") |
| 55 | return min_val if option else max_val |
| 56 | |
| 57 | |
| 58 | def get_avg(number_1: int, number_2: int) -> int: |
nothing calls this directly
no outgoing calls
no test coverage detected