'''test pysftp module - uses py.test'''

# the following 3 lines let py.test find the module
import sys, os
MYPATH = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, MYPATH + '/../')

import pysftp


def test_connection_good():
    '''connect to a public sftp server'''
    sftp = pysftp.Connection(host='test.rebex.net',
                             username='demo',
                             password='password')
    sftp.close()


def test_connection_bad():
    '''attempt connection to a non-existing server'''
    try:
        sftp = pysftp.Connection('nota.realserver.pri')
        assert False
    except:
        assert True


@@ -443,16 +443,145 @@
 ose()%0A%0A%0A
+def test_connection_local():%0A    '''try and connect to localhost'''%0A    sftp = pysftp.Connection('localhost')%0A    sftp.close()%0A%0A%0A
 def test

test conn to localhost on ci