Skip to content

Commit

Permalink
Delint test_sftp (remove unused imports and unused variables, remove …
Browse files Browse the repository at this point in the history
…excess whitespace, move imports to top, remove semicolon terminator)

--HG--
extra : source : 01df712a396de5fa7e1c0cc265411fdb2bbc5f41
  • Loading branch information
jaraco committed Mar 4, 2013
1 parent 721f74d commit 3a9119d
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions tests/test_sftp.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,10 @@
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
Expand Down Expand Up @@ -227,7 +224,7 @@ def test_5_rename(self):
"""
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:
Expand Down Expand Up @@ -438,7 +435,7 @@ def test_C_symlink(self):
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('.')
Expand Down Expand Up @@ -566,7 +563,6 @@ def test_H_get_put(self):
"""
verify that get/put work.
"""
import os, warnings
warnings.filterwarnings('ignore', 'tempnam.*')

localname = os.tempnam()
Expand Down Expand Up @@ -631,7 +627,7 @@ def test_J_x_flag(self):
try:
f = sftp.open(FOLDER + '/unusual.txt', 'wx')
self.fail('expected exception')
except IOError, x:
except IOError:
pass
finally:
sftp.unlink(FOLDER + '/unusual.txt')
Expand Down Expand Up @@ -671,12 +667,12 @@ def test_M_bad_readv(self):
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')
Expand All @@ -685,7 +681,6 @@ def test_N_put_without_confirm(self):
"""
verify that get/put work without confirmation.
"""
import os, warnings
warnings.filterwarnings('ignore', 'tempnam.*')

localname = os.tempnam()
Expand All @@ -697,7 +692,7 @@ def test_N_put_without_confirm(self):
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')
Expand Down Expand Up @@ -729,4 +724,3 @@ def XXX_test_M_seek_append(self):
f.close()
finally:
sftp.remove(FOLDER + '/append.txt')

0 comments on commit 3a9119d

Please sign in to comment.