diff options
author | Robey Pointer <robey@lag.net> | 2005-11-12 01:10:41 +0000 |
---|---|---|
committer | Robey Pointer <robey@lag.net> | 2005-11-12 01:10:41 +0000 |
commit | 6de6dc72c659f17fec8fb3a5c97f45c7db4c6622 (patch) | |
tree | c1d5391cc267c00affcf5347b58d9ca2df1f4919 /tests/test_sftp.py | |
parent | 7e95e2afc8200b82a352f6f5f0935286c1a0f352 (diff) |
[project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-80]
add 'x' flag to open to allow O_EXCL behavior
Diffstat (limited to 'tests/test_sftp.py')
-rwxr-xr-x | tests/test_sftp.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_sftp.py b/tests/test_sftp.py index 94e9dea5..3372e8f8 100755 --- a/tests/test_sftp.py +++ b/tests/test_sftp.py @@ -670,3 +670,19 @@ class SFTPTest (unittest.TestCase): paramiko.util.hexify(sum)) finally: sftp.unlink(FOLDER + '/kitty.txt') + + def test_N_x_flag(self): + """ + verify that the 'x' flag works when opening a file. + """ + f = sftp.open(FOLDER + '/unusual.txt', 'wx') + f.close() + + try: + try: + f = sftp.open(FOLDER + '/unusual.txt', 'wx') + self.fail('expected exception') + except IOError, x: + pass + finally: + sftp.unlink(FOLDER + '/unusual.txt') |