summaryrefslogtreecommitdiffhomepage
path: root/tests/test_sftp.py
diff options
context:
space:
mode:
authorRobey Pointer <robey@lag.net>2005-11-12 01:10:41 +0000
committerRobey Pointer <robey@lag.net>2005-11-12 01:10:41 +0000
commit6de6dc72c659f17fec8fb3a5c97f45c7db4c6622 (patch)
treec1d5391cc267c00affcf5347b58d9ca2df1f4919 /tests/test_sftp.py
parent7e95e2afc8200b82a352f6f5f0935286c1a0f352 (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-xtests/test_sftp.py16
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')