Skip to content

Commit

Permalink
test: finish huge test implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
Donaim committed May 31, 2023
1 parent 8a35df6 commit 653fa69
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions tests/test_end_to_end.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import requests
import filecmp
import os
import tarfile
import intact.intact as main

def run_end_to_end(tmp_path, data_file, expected_dir):
Expand Down Expand Up @@ -36,14 +37,19 @@ def test_large(tmp_path):

@pytest.fixture(scope="session")
def huge_data_file(tmpdir_factory):
tmp_dir = tmpdir_factory.mktemp('downloaded_files')
tmp_tar_path = tmp_dir.join('test_file.tar')
# response = requests.get("https://github.com/cfe-lab/HIVIntact/releases/download/test-data/huge-data-file.tar")
# with open(tmp_path, 'wb') as f:
# f.write(response.content)

# return (tmp_path, "tmp1")
return ("/home/doname/my/wd/hiv_sequences/all-psd-subtype-b-long.fasta", "haha")
tmp_dir = tmpdir_factory.mktemp("downloaded_files")
tmp_tar_path = tmp_dir.join("test_file.tar.gz")
data_file = tmp_dir.join("hivintact_data", "all-psd-subtype-b-long.fasta")
expected_dir = tmp_dir.join("hivintact_data", "expected-output")

response = requests.get("https://github.com/cfe-lab/HIVIntact/releases/download/test-data/hivintact_data.tar.gz")
with open(tmp_tar_path, "wb") as f:
f.write(response.content)

with tarfile.open(tmp_tar_path, "r:gz") as tar:
tar.extractall(path=tmp_dir)

return (data_file, expected_dir)


@pytest.mark.slow
Expand Down

0 comments on commit 653fa69

Please sign in to comment.