How to use the pysftp.st_mode_to_int function in pysftp

To help you get started, we’ve selected a few pysftp examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jrderuiter / airflow-fs / tests / airflow_fs / hooks / test_sftp_hook.py View on Github external
def test_mkdir(self, sftp_conn, sftp_client, tmpdir):
        """Tests the `mkdir` method with mode parameter."""

        dir_path = posixpath.join(str(tmpdir), "subdir")
        assert not sftp_client.exists(dir_path)

        with SftpHook("sftp_default") as hook:
            hook.mkdir(dir_path, mode=0o750)

        assert sftp_client.exists(dir_path)
        assert pysftp.st_mode_to_int(sftp_client.stat(dir_path).st_mode) == 750
github jrderuiter / airflow-fs / tests / airflow_fs / hooks / test_sftp_hook.py View on Github external
def test_makedirs(self, sftp_conn, sftp_client, tmpdir):
        """Tests the `mkdir` method with mode parameter."""

        dir_path = posixpath.join(str(tmpdir), "some", "nested", "dir")

        with SftpHook("sftp_default") as hook:
            hook.makedirs(dir_path, mode=0o750)

        assert sftp_client.exists(dir_path)
        assert pysftp.st_mode_to_int(sftp_client.stat(dir_path).st_mode) == 750