Unit tests for utils.py