Add method 'isdir' in connection.py, and the test for this method.