island: Add `dir_is_empty()` to clarify intent of `test_remove_pba_files()`
This commit is contained in:
parent
e3449d17c7
commit
db14285934
|
@ -25,13 +25,14 @@ def test_remove_pba_files():
|
||||||
create_custom_pba_file("linux_file")
|
create_custom_pba_file("linux_file")
|
||||||
create_custom_pba_file("windows_file")
|
create_custom_pba_file("windows_file")
|
||||||
|
|
||||||
custom_pda_dir_contents = os.listdir(PostBreachFilesService.get_custom_pba_directory())
|
assert not dir_is_empty(PostBreachFilesService.get_custom_pba_directory())
|
||||||
assert len(custom_pda_dir_contents) == 2
|
|
||||||
|
|
||||||
PostBreachFilesService.remove_PBA_files()
|
PostBreachFilesService.remove_PBA_files()
|
||||||
|
assert dir_is_empty(PostBreachFilesService.get_custom_pba_directory())
|
||||||
|
|
||||||
custom_pda_dir_contents = os.listdir(PostBreachFilesService.get_custom_pba_directory())
|
|
||||||
assert len(custom_pda_dir_contents) == 0
|
def dir_is_empty(dir_path):
|
||||||
|
dir_contents = os.listdir(dir_path)
|
||||||
|
return len(dir_contents) == 0
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif(os.name != "posix", reason="Tests Posix (not Windows) permissions.")
|
@pytest.mark.skipif(os.name != "posix", reason="Tests Posix (not Windows) permissions.")
|
||||||
|
|
Loading…
Reference in New Issue