# Path: pysecure/test/test_base.py
# def connect_sftp_test(sftp_cb):
#     print("Connecting SFTP with key: %s" % (key_filepath))
#     auth_cb = get_key_auth_cb(key_filepath)
#     connect_sftp_with_cb(sftp_cb, user, host, auth_cb, verbosity=verbosity)


from unittest import TestCase
from pysecure.test.test_base import connect_sftp_test


class SftpLsTest(TestCase):
    def __sftp_cb(self, ssh, sftp):
#        print("Name                         Size Perms    Owner\tGroup\n")
        for attributes in sftp.listdir('.'):
            print("%-40s %10d %.8o %s(%d)\t%s(%d)" % 
                  (attributes.name[0:40], attributes.size, 
                   attributes.permissions, attributes.owner, 
                   attributes.uid, attributes.group, attributes.gid))

    def test_sftp_ls(self):

# Path: pysecure/test/test_base.py
# def connect_sftp_test(sftp_cb):
#     print("Connecting SFTP with key: %s" % (key_filepath))
#     auth_cb = get_key_auth_cb(key_filepath)
#     connect_sftp_with_cb(sftp_cb, user, host, auth_cb, verbosity=verbosity)


# Path: pysecure/test/sftp_ls.py
from unittest import TestCase
from pysecure.test.test_base import connect_sftp_test



class SftpLsTest(TestCase):
    def __sftp_cb(self, ssh, sftp):
#        print("Name                         Size Perms    Owner\tGroup\n")
        for attributes in sftp.listdir('.'):
            print("%-40s %10d %.8o %s(%d)\t%s(%d)" % 
                  (attributes.name[0:40], attributes.size, 
                   attributes.permissions, attributes.owner, 
                   attributes.uid, attributes.group, attributes.gid))

    def test_sftp_ls(self):

        connect_sftp_test(self.__sftp_cb)