Skip to content

Commit

Permalink
AL-131 Add streaming read operation
Browse files Browse the repository at this point in the history
 - Adds SFTP server container to docker compose
 - Adds lines for testing read() operations
  • Loading branch information
cccs-samp authored and cccs-douglass committed Jul 28, 2021
1 parent 7de506d commit c805dd5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
8 changes: 7 additions & 1 deletion test/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,10 @@ services:
ports:
- '21:21'
- '20:20'
- '21100-21110:21100-21110'
- '21100-21110:21100-21110'

sftpServer:
image: atmoz/sftp
ports:
- '2222:22'
command: sftp_test_user:password:1001::test
12 changes: 10 additions & 2 deletions test/test_filestore.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,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():
Expand All @@ -88,6 +94,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():
Expand Down

0 comments on commit c805dd5

Please sign in to comment.