Skip to content

Commit

Permalink
Fix step directory "{dirpath}" is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
jrohel authored and m-blaha committed Feb 19, 2025
1 parent 381a133 commit 8e99245
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dnf-behave-tests/common/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ def step_delete_directory(context, dirpath):
@behave.step('directory "{dirpath}" is empty')
def directory_is_empty(context, dirpath):
full_path = prepend_installroot(context, dirpath)
return bool(os.listdir(full_path))
found = os.listdir(full_path)
if len(found) > 0:
raise AssertionError('Directory "{}" contains: \n{}'.format(full_path, '\n'.join(found)))


@behave.step('file "{filepath}" exists')
Expand Down

0 comments on commit 8e99245

Please sign in to comment.