Unit tests for bases.py