Skip to content
Snippets Groups Projects
Commit 25d21a1b50c5 authored by Jeff Forcier's avatar Jeff Forcier
Browse files

Refactoring: it's a thing. Re #85

parent 05d2fe56ddbf
Branches
No related tags found
No related merge requests found
......@@ -26,6 +26,8 @@
from paramiko.buffered_pipe import BufferedPipe, PipeTimeout
from paramiko import pipe
from util import ParamikoTest
def delay_thread(pipe):
pipe.feed('a')
......@@ -39,11 +41,7 @@
pipe.close()
class BufferedPipeTest (unittest.TestCase):
assertTrue = unittest.TestCase.failUnless # for Python 2.3 and below
assertFalse = unittest.TestCase.failIf # for Python 2.3 and below
class BufferedPipeTest(ParamikoTest):
def test_1_buffered_pipe(self):
p = BufferedPipe()
self.assert_(not p.read_ready())
......
......@@ -36,6 +36,7 @@
from paramiko.common import MSG_KEXINIT, MSG_CHANNEL_WINDOW_ADJUST
from paramiko.message import Message
from loop import LoopSocket
from util import ParamikoTest
LONG_BANNER = """\
......@@ -105,13 +106,7 @@
return OPEN_SUCCEEDED
class TransportTest (unittest.TestCase):
if not hasattr(unittest.TestCase, 'assertTrue'):
assertTrue = unittest.TestCase.failUnless # for Python 2.3 and below
if not hasattr(unittest.TestCase, 'assertFalse'):
assertFalse = unittest.TestCase.failIf # for Python 2.3 and below
class TransportTest(ParamikoTest):
def setUp(self):
self.socks = LoopSocket()
self.sockc = LoopSocket()
......
......@@ -28,6 +28,7 @@
from Crypto.Hash import SHA
import paramiko.util
from util import ParamikoTest
test_config_file = """\
Host *
......@@ -58,17 +59,7 @@
from paramiko import *
class UtilTest (unittest.TestCase):
assertTrue = unittest.TestCase.failUnless # for Python 2.3 and below
assertFalse = unittest.TestCase.failIf # for Python 2.3 and below
def setUp(self):
pass
def tearDown(self):
pass
class UtilTest(ParamikoTest):
def test_1_import(self):
"""
verify that all the classes can be imported from paramiko.
......
import unittest
class ParamikoTest(unittest.TestCase):
# for Python 2.3 and below
if not hasattr(unittest.TestCase, 'assertTrue'):
assertTrue = unittest.TestCase.failUnless
if not hasattr(unittest.TestCase, 'assertFalse'):
assertFalse = unittest.TestCase.failIf
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment