-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Adds SFTP server container to docker compose - Adds lines for testing read() operations
- Loading branch information
Showing
3 changed files
with
19 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,7 @@ def test_http(): | |
httpObject = fs.read('assemblyline') | ||
assert httpObject.read(chunk_size=32) is not None | ||
|
||
|
||
def test_https(): | ||
""" | ||
Test HTTPS FileStore by fetching the assemblyline page on | ||
|
@@ -53,22 +54,28 @@ def test_https(): | |
# Rebex test server. | ||
# """ | ||
# fs = FileStore('sftp://demo:[email protected]') | ||
# # fs = FileStore('sftp://sftp_test_user:password@localhost:2222') | ||
# # fs.upload('readme.txt', 'readme.txt') | ||
# assert fs.exists('readme.txt') != [] | ||
# assert fs.get('readme.txt') is not None | ||
# sftpfile = fs.read('readme.txt') | ||
# assert sftpfile.read() is not None | ||
|
||
|
||
def test_ftp(): | ||
""" | ||
Test FTP FileStore by fetching the readme.txt file from | ||
Rebex test server. | ||
containerized server. | ||
""" | ||
fs = FileStore('ftp://al_test_user:password@localhost') | ||
|
||
fs.upload('readme.txt', 'readme.txt') | ||
# fs = FileStore('ftp://demo:[email protected]') | ||
assert fs.exists('readme.txt') != [] | ||
assert fs.get('readme.txt') is not None | ||
ftpfile = fs.read('readme.txt') | ||
assert ftpfile.read() is not None | ||
fs.delete('readme.txt') | ||
assert fs.exists('readme.txt') == [] | ||
|
||
|
||
# def test_ftps(): | ||
|
@@ -79,6 +86,8 @@ def test_ftp(): | |
# fs = FileStore('ftps://demo:[email protected]') | ||
# assert fs.exists('readme.txt') != [] | ||
# assert fs.get('readme.txt') is not None | ||
# ftpsfile = fs.read('readme.txt') | ||
# assert ftpsfile.read() is not None | ||
|
||
|
||
def test_file(): | ||
|