Skip to content

Commit

Permalink
Fixed the line for linux
Browse files Browse the repository at this point in the history
  • Loading branch information
fujiisoup committed Nov 11, 2024
1 parent 038a1a1 commit 0e981d6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
Binary file added testings/corrupt_data/c0rrupt.sif
Binary file not shown.
8 changes: 1 addition & 7 deletions testings/test_open.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,11 @@
def assert_file_not_in_use(filename):
platform = sys.platform
if platform == "linux":
from subprocess import check_output,Popen, PIPE

lsout = Popen(['lsof',filename],stdout=PIPE, shell=False)
check_output(["grep",filename], stdin=lsout.stdout, shell=False)

for proc in psutil.process_iter():
try:
for item in proc.open_files():
if filename == item.path:
return True
raise Exception("File is in use.")
except Exception:
pass
raise Exception("File is in use.")
Expand All @@ -76,7 +71,6 @@ def assert_file_not_in_use(filename):
raise Exception("OS not supported")



def test_step_and_glue():
filename = THIS_DIR + "/step_and_glue/step_and_glue.sif"
with open(filename, "rb") as f:
Expand Down

0 comments on commit 0e981d6

Please sign in to comment.