From 55cea57ffa45ad4ef062363c8ec214e81f8c2448 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Sun, 11 Aug 2019 13:00:58 +0200 Subject: [PATCH] Fix tests for file_transfer and perceptron.py (#1121) --- .travis.yml | 31 -------------------------- file_transfer/ftp_send_receive.py | 36 ------------------------------- 2 files changed, 67 deletions(-) delete mode 100644 file_transfer/ftp_send_receive.py diff --git a/.travis.yml b/.travis.yml index 532f73f5e..f7a926480 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,32 +4,6 @@ python: 3.7 cache: pip before_install: pip install --upgrade pip setuptools install: pip install -r requirements.txt -matrix: - include: - - name: "Main tests" - # The following files currently fail pytests. See issues: #1016, #1044, #1080 - # Here they are run allow_failures mode and when each passes pytest, it can be - # removed BOTH lists below. Complex now but simple once all files pass pytest. - # - env: FILE=pytest file_transfer_protocol/ftp_client_server.py - # before_script: true - # script: pytest ${FILE} --doctest-modules - - env: FILE=pytest file_transfer/ftp_send_receive.py - before_script: true - script: pytest ${FILE} --doctest-modules - - env: FILE=pytest machine_learning/linear_regression.py - before_script: true - script: pytest ${FILE} --doctest-modules - - env: FILE=pytest machine_learning/perceptron.py - before_script: true - script: pytest ${FILE} --doctest-modules - - env: FILE=pytest machine_learning/random_forest_classification/random_forest_classification.py - before_script: true - script: pytest ${FILE} --doctest-modules - - env: FILE=pytest machine_learning/random_forest_regression/random_forest_regression.py - before_script: true - script: pytest ${FILE} --doctest-modules - allow_failures: - - before_script: true before_script: - black --check . || true - flake8 . --count --select=E9,F401,F63,F7,F82 --show-source --statistics @@ -37,11 +11,6 @@ script: - scripts/validate_filenames.py # no uppercase, no spaces, in a directory - mypy --ignore-missing-imports . - pytest . --doctest-modules - --ignore=file_transfer/ftp_send_receive.py - --ignore=machine_learning/linear_regression.py - --ignore=machine_learning/perceptron.py - --ignore=machine_learning/random_forest_classification/random_forest_classification.py - --ignore=machine_learning/random_forest_regression/random_forest_regression.py after_success: - scripts/build_directory_md.py > DIRECTORY.md - cat DIRECTORY.md diff --git a/file_transfer/ftp_send_receive.py b/file_transfer/ftp_send_receive.py deleted file mode 100644 index 6a9819ef3..000000000 --- a/file_transfer/ftp_send_receive.py +++ /dev/null @@ -1,36 +0,0 @@ -""" -File transfer protocol used to send and receive files using FTP server. -Use credentials to provide access to the FTP client - -Note: Do not use root username & password for security reasons -Create a seperate user and provide access to a home directory of the user -Use login id and password of the user created -cwd here stands for current working directory -""" - -from ftplib import FTP -ftp = FTP('xxx.xxx.x.x') # Enter the ip address or the domain name here -ftp.login(user='username', passwd='password') -ftp.cwd('/Enter the directory here/') - -""" -The file which will be received via the FTP server -Enter the location of the file where the file is received -""" - -def ReceiveFile(): - FileName = 'example.txt' """ Enter the location of the file """ - with open(FileName, 'wb') as LocalFile: - ftp.retrbinary('RETR ' + FileName, LocalFile.write, 1024) - ftp.quit() - -""" -The file which will be sent via the FTP server -The file send will be send to the current working directory -""" - -def SendFile(): - FileName = 'example.txt' """ Enter the name of the file """ - with open(FileName, 'rb') as LocalFile: - ftp.storbinary('STOR ' + FileName, LocalFile) - ftp.quit()