Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
paramiko
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenVMS
Python
Modules
paramiko
Commits
25d21a1b50c5
Commit
25d21a1b50c5
authored
12 years ago
by
Jeff Forcier
Browse files
Options
Downloads
Patches
Plain Diff
Refactoring: it's a thing. Re #85
parent
05d2fe56ddbf
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
tests/test_buffered_pipe.py
+3
-5
3 additions, 5 deletions
tests/test_buffered_pipe.py
tests/test_transport.py
+2
-7
2 additions, 7 deletions
tests/test_transport.py
tests/test_util.py
+2
-11
2 additions, 11 deletions
tests/test_util.py
tests/util.py
+10
-0
10 additions, 0 deletions
tests/util.py
with
17 additions
and
23 deletions
tests/test_buffered_pipe.py
+
3
−
5
View file @
25d21a1b
...
...
@@ -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
())
...
...
This diff is collapsed.
Click to expand it.
tests/test_transport.py
+
2
−
7
View file @
25d21a1b
...
...
@@ -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
()
...
...
This diff is collapsed.
Click to expand it.
tests/test_util.py
+
2
−
11
View file @
25d21a1b
...
...
@@ -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.
...
...
This diff is collapsed.
Click to expand it.
tests/util.py
0 → 100644
+
10
−
0
View file @
25d21a1b
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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment