Add basic test for connection.py, and add missing 'self.' in connection.py