Write Python Tests
Write a set of unit tests using pytest that cover edge cases, invalid inputs, and expected behavior for this Python function.