Skip to content

Commit

Permalink
fix: default return value type of ls.listing_of() (#4343)
Browse files Browse the repository at this point in the history
Signed-off-by: Xiaoxue Wang <[email protected]>
  • Loading branch information
JoySnow authored Jan 24, 2025
1 parent a05eb91 commit f28e238
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion insights/parsers/ls.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def listing_of(self, directory):
"""
if directory in self:
return self[directory]['entries']
return []
return {}

def dir_contains(self, directory, name):
"""
Expand Down
2 changes: 1 addition & 1 deletion insights/tests/parsers/test_ls.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ def test_ls_lanR():
assert ls.files_of('non-exist') == []
assert ls.dirs_of('non-exist') == []
assert ls.specials_of('non-exist') == []
assert ls.listing_of('non-exist') == []
assert ls.listing_of('non-exist') == {}
assert ls.total_of('non-exist') == 0
assert ls.dir_contains('non-exist', 'test') is False
assert ls.dir_entry('non-exist', 'test') == {}
Expand Down
2 changes: 1 addition & 1 deletion insights/tests/parsers/test_ls_file_listing.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def test_multiple_directories():
assert dirs.files_of('non-exist') == []
assert dirs.dirs_of('non-exist') == []
assert dirs.specials_of('non-exist') == []
assert dirs.listing_of('non-exist') == []
assert dirs.listing_of('non-exist') == {}
assert dirs.total_of('non-exist') == 0
assert dirs.dir_contains('non-exist', 'test') is False
assert dirs.dir_entry('non-exist', 'test') == {}
Expand Down

0 comments on commit f28e238

Please sign in to comment.