Skip to content

Commit

Permalink
Issue #74: Remove os.system() in test_datasets.py.
Browse files Browse the repository at this point in the history
  • Loading branch information
bongjinkoo committed May 17, 2022
1 parent 9039ec6 commit d0a5342
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/test_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import os
import random
import string
import subprocess

import pytest

Expand All @@ -22,7 +23,7 @@ def setup():
username="[email protected]",
token="HBGGBOJcLYQfadEKIOyXJiLTum3ydXK4nGP3KmbkYUeBuYkZma9LPBSYennQn92gjP2NHn",
project_id="xbr2m",
osflient_path="$CONDA/bin/",
osfclient_path="$CONDA/bin/",
)
yield project

Expand Down Expand Up @@ -91,7 +92,7 @@ def test_upload_valid(setup, set_file_path):
line = file_list.readline()

assert file_exists
os.system(f"rm {set_file_path[0]}{set_file_path[1]}")
subprocess.run(f"rm {set_file_path[0]}{set_file_path[1]}", shell=True)


def test_upload_invalid_because_no_local_path(setup):
Expand All @@ -110,7 +111,7 @@ def test_download_valid(setup, set_file_path):
"""Test the download method."""
setup.download(set_file_path[1], set_file_path[0] + set_file_path[1])
assert os.path.exists(set_file_path[0] + set_file_path[1])
os.system(f"rm {set_file_path[0]}{set_file_path[1]}")
subprocess.run(f"rm {set_file_path[0]}{set_file_path[1]}", shell=True)


def test_download_invalid_because_no_remote_path(setup):
Expand Down

0 comments on commit d0a5342

Please sign in to comment.