Skip to content

Commit e109151

Browse files
author
Pan
committed
Updated readme.
Updated travis cfg. Updated sftp test to use context manager.
1 parent 20b2165 commit e109151

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
lines changed

.travis.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ language: python
22
cache: pip
33
notifications:
44
email: false
5+
sudo: required
56
services:
67
- docker
78
python:
@@ -19,11 +20,14 @@ addons:
1920
- libssh2-1-dev
2021
- openssh-server
2122
install:
22-
- pip install flake8
23+
- pip install flake8 jinja2
2324
- python setup.py build_ext --inplace
2425
- eval "$(ssh-agent -s)"
2526
script:
27+
- nosetests
28+
- flake8 ssh2
2629
- docker/build-packages.sh
30+
- ls -ltrh
2731
deploy:
2832
- provider: pypi
2933
on:

README.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ Super fast SSH2 protocol library. ``ssh2-python`` provides Python bindings for `
99
.. image:: https://img.shields.io/pypi/v/ssh2-python.svg
1010
:target: https://pypi.python.org/pypi/ssh2-python
1111
:alt: Latest Version
12-
12+
.. image:: https://travis-ci.org/ParallelSSH/ssh2-python.svg?branch=master
13+
:target: https://travis-ci.org/ParallelSSH/ssh2-python
1314

1415
Installation
1516
______________
@@ -30,7 +31,7 @@ RedHat
3031

3132
.. code-block:: shell
3233
33-
yum install libssh2-devel python-dev
34+
yum install libssh2-devel python-devel
3435
pip install ssh2-python
3536
3637

tests/test_ssh2.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -169,16 +169,16 @@ def test_sftp(self):
169169
'remote_test_file'])
170170
with open(remote_filename, 'wb') as test_fh:
171171
test_fh.write(test_file_data)
172-
remote_fh = sftp.open(remote_filename, 0, 0)
173-
try:
174-
self.assertTrue(remote_fh is not None)
175-
remote_data = b""
176-
for data in remote_fh:
177-
remote_data += data
178-
self.assertEqual(remote_fh.close(), 0)
179-
self.assertEqual(remote_data, test_file_data)
180-
finally:
181-
os.unlink(remote_filename)
172+
with sftp.open(remote_filename, 0, 0) as remote_fh:
173+
try:
174+
self.assertTrue(remote_fh is not None)
175+
remote_data = b""
176+
for data in remote_fh:
177+
remote_data += data
178+
self.assertEqual(remote_fh.close(), 0)
179+
self.assertEqual(remote_data, test_file_data)
180+
finally:
181+
os.unlink(remote_filename)
182182

183183
def test_setenv(self):
184184
self.assertEqual(self._auth(), 0)

0 commit comments

Comments
 (0)