summaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-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')