forked from exasol/bucketfs-utils-python
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#114 Added the first integration test for the path builder.
- Loading branch information
Showing
4 changed files
with
48 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from exasol.bucketfs._path import build_path, SYSTEM_TYPE_ONPREM | ||
from integration.conftest import delete_file | ||
|
||
|
||
def test_write_read_back(test_config): | ||
|
||
file_name = 'my_poems/little_star.txt' | ||
data = b'twinkle twinkle little star how i wonder what you are' | ||
base_path = build_path(system=SYSTEM_TYPE_ONPREM, url=test_config.url, | ||
username=test_config.username, password=test_config.password) | ||
poem_path = base_path / file_name | ||
|
||
try: | ||
poem_path.write(data) | ||
data_back = b''.join(poem_path.read(20)) | ||
assert data_back == data | ||
finally: | ||
# cleanup | ||
delete_file( | ||
test_config.url, | ||
'default', | ||
test_config.username, | ||
test_config.password, | ||
file_name, | ||
) |
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