Permalink
Browse files

fix OSX errors

  • Loading branch information...
giampaolo committed Apr 22, 2017
1 parent e9b4dc0 commit 07ed743f4fb26f89231ff6e5e2521f2c67f64f67
Showing with 12 additions and 19 deletions.
  1. +0 −1 .ci/travis/run.sh
  2. +0 −11 .travis.yml
  3. +0 −2 Makefile
  4. +0 −2 make.bat
  5. +12 −3 pyftpdlib/test/test_functional_ssl.py
View
@@ -13,7 +13,6 @@ fi
python setup.py install
python pyftpdlib/test/runner.py
# run linter only on Linux and on latest python versions
if [ "$PYVER" == "2.7" ] || [ "$PYVER" == "3.6" ]; then
if [[ "$(uname -s)" != 'Darwin' ]]; then
View
@@ -9,28 +9,17 @@ matrix:
- python: 3.4
- python: 3.5
- python: 3.6
# - language: generic
# os: osx
# env: PYVER=py26
- language: generic
os: osx
env: PYVER=py27
# - language: generic
# os: osx
# env: PYVER=py33
- language: generic
os: osx
env: PYVER=py34
# XXX - not supported yet
# - language: generic
# os: osx
# env: PYVER=py35
install:
- ./.ci/travis/install.sh
script:
- ./.ci/travis/run.sh
after_success:
# upload reports to coveralls.io
- |
if [ "$(uname -s)" != 'Darwin' ]; then
coveralls
View
@@ -9,7 +9,6 @@ ARGS=
DEPS=coverage \
check-manifest \
flake8 \
ipdb \
mock==1.0.1 \
nose \
pep8 \
@@ -18,7 +17,6 @@ DEPS=coverage \
pysendfile \
setuptools \
sphinx \
sphinx-pypi-upload \
unittest2
# In not in a virtualenv, add --user options for install commands.
View
@@ -89,8 +89,6 @@ if "%1" == "setup-dev-env" (
@echo ------------------------------------------------
rem mandatory / for unittests
%PYTHON% -m pip install unittest2 ipaddress mock wmi pypiwin32 pyopenssl --upgrade
rem nice to have
rem %PYTHON% -m pip install ipdb nose --upgrade
goto :eof
)
@@ -15,6 +15,7 @@
from pyftpdlib.handlers import TLS_FTPHandler
from pyftpdlib.test import configure_logging
from pyftpdlib.test import OSX
from pyftpdlib.test import PASSWD
from pyftpdlib.test import remove_test_files
from pyftpdlib.test import ThreadedTestFTPd
@@ -359,6 +360,8 @@ def try_protocol_combo(self, server_protocol, client_protocol):
# for proto in protos:
# self.try_protocol_combo(ssl.PROTOCOL_TLSv1, proto)
# On OSX TLS_FTPHandler.get_ssl_context()._context does not exist.
@unittest.skipIf(OSX, "can't get options on OSX")
def test_ssl_options(self):
from OpenSSL import SSL
from OpenSSL._util import lib
@@ -393,9 +396,15 @@ def test_ssl_options(self):
def test_sslv2(self):
self.client.ssl_version = ssl.PROTOCOL_SSLv2
self.client.close()
with self.server.lock:
self.client.connect(self.server.host, self.server.port)
self.assertRaises(socket.error, self.client.login)
if not OSX:
with self.server.lock:
self.client.connect(self.server.host, self.server.port)
self.assertRaises(socket.error, self.client.login)
else:
with self.server.lock:
with self.assertRaises(socket.error):
self.client.connect(self.server.host, self.server.port,
timeout=0.1)
self.client.ssl_version = ssl.PROTOCOL_SSLv2

0 comments on commit 07ed743

Please sign in to comment.