Tested example.py on postgres. Added unit tests