Skip to content

Commit

Permalink
capturing an exception
Browse files Browse the repository at this point in the history
  • Loading branch information
ahsimb committed Oct 8, 2024
1 parent 4585a32 commit 32d200d
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions pytest-extension/test/integration/pytest_extension_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,22 @@ def validate_database_std_params(**kwargs):
bfs_kwargs = None
def validate_bucketfs_std_params(**kwargs):
global bfs_kwargs
# Temporary work around for the bug in PEC (Issue#78 - no default for the path_in_bucket
if StdParams.path_in_bucket.name in kwargs and kwargs[StdParams.path_in_bucket.name] is None:
kwargs[StdParams.path_in_bucket.name] = ''
if bfs_kwargs is None:
bfs_kwargs = dict(kwargs)
bfs_path = create_bucketfs_location(**bfs_kwargs)
bfs_path = bfs_path / 'test_file.txt'
bfs_path.write(TEST_FILE_CONTENT)
file_content = b"".join(bfs_path.read())
assert file_content == TEST_FILE_CONTENT
error == ''
try:
global bfs_kwargs
# Temporary work around for the bug in PEC (Issue#78 - no default for the path_in_bucket
if StdParams.path_in_bucket.name in kwargs and kwargs[StdParams.path_in_bucket.name] is None:
kwargs[StdParams.path_in_bucket.name] = ''
if bfs_kwargs is None:
bfs_kwargs = dict(kwargs)
bfs_path = create_bucketfs_location(**bfs_kwargs)
bfs_path = bfs_path / 'test_file.txt'
bfs_path.write(TEST_FILE_CONTENT)
file_content = b"".join(bfs_path.read())
assert file_content == TEST_FILE_CONTENT
except Exception as ex:
error = str(ex)
assert not error
def validate_cli_args(backend, cli_args, base_tag, callback):
if backend == BACKEND_ONPREM:
Expand Down

0 comments on commit 32d200d

Please sign in to comment.