summaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2013-03-04 08:17:22 -0500
committerJason R. Coombs <jaraco@jaraco.com>2013-03-04 08:17:22 -0500
commit3a9119d78a8745e4e45bea0881bfae3deb2adab3 (patch)
treee424b253af363c82b45e126fd6687574786cf0df /tests
parent721f74d8c240071e444ed1cdfff432c75339e8b2 (diff)
Delint test_sftp (remove unused imports and unused variables, remove excess whitespace, move imports to top, remove semicolon terminator)
--HG-- extra : source : 01df712a396de5fa7e1c0cc265411fdb2bbc5f41
Diffstat (limited to 'tests')
-rwxr-xr-xtests/test_sftp.py20
1 files changed, 7 insertions, 13 deletions
diff --git a/tests/test_sftp.py b/tests/test_sftp.py
index f95da69c..dfd673a9 100755
--- a/tests/test_sftp.py
+++ b/tests/test_sftp.py
@@ -26,13 +26,10 @@ do test file operations in (so no existing files will be harmed).
from __future__ import with_statement
from binascii import hexlify
-import logging
import os
-import random
-import struct
+import warnings
import sys
import threading
-import time
import unittest
import paramiko
@@ -227,7 +224,7 @@ class SFTPTest (unittest.TestCase):
"""
f = sftp.open(FOLDER + '/first.txt', 'w')
try:
- f.write('content!\n');
+ f.write('content!\n')
f.close()
sftp.rename(FOLDER + '/first.txt', FOLDER + '/second.txt')
try:
@@ -438,7 +435,7 @@ class SFTPTest (unittest.TestCase):
self.assertEqual(sftp.readlink(FOLDER + '/link.txt'), 'original.txt')
f = sftp.open(FOLDER + '/link.txt', 'r')
- self.assertEqual(f.readlines(), [ 'original\n' ])
+ self.assertEqual(f.readlines(), ['original\n'])
f.close()
cwd = sftp.normalize('.')
@@ -566,7 +563,6 @@ class SFTPTest (unittest.TestCase):
"""
verify that get/put work.
"""
- import os, warnings
warnings.filterwarnings('ignore', 'tempnam.*')
localname = os.tempnam()
@@ -631,7 +627,7 @@ class SFTPTest (unittest.TestCase):
try:
f = sftp.open(FOLDER + '/unusual.txt', 'wx')
self.fail('expected exception')
- except IOError, x:
+ except IOError:
pass
finally:
sftp.unlink(FOLDER + '/unusual.txt')
@@ -671,12 +667,12 @@ class SFTPTest (unittest.TestCase):
f.close()
try:
f = sftp.open(FOLDER + '/zero', 'r')
- data = f.readv([(0, 12)])
+ f.readv([(0, 12)])
f.close()
f = sftp.open(FOLDER + '/zero', 'r')
f.prefetch()
- data = f.read(100)
+ f.read(100)
f.close()
finally:
sftp.unlink(FOLDER + '/zero')
@@ -685,7 +681,6 @@ class SFTPTest (unittest.TestCase):
"""
verify that get/put work without confirmation.
"""
- import os, warnings
warnings.filterwarnings('ignore', 'tempnam.*')
localname = os.tempnam()
@@ -697,7 +692,7 @@ class SFTPTest (unittest.TestCase):
def progress_callback(x, y):
saved_progress.append((x, y))
res = sftp.put(localname, FOLDER + '/bunny.txt', progress_callback, False)
-
+
self.assertEquals(SFTPAttributes().attr, res.attr)
f = sftp.open(FOLDER + '/bunny.txt', 'r')
@@ -729,4 +724,3 @@ class SFTPTest (unittest.TestCase):
f.close()
finally:
sftp.remove(FOLDER + '/append.txt')
-