Skip to content

Commit

Permalink
Merge pull request #39 from fedorov/38-fix-tests-paths
Browse files Browse the repository at this point in the history
BUG: fix path to the manifests used by tests
  • Loading branch information
fedorov authored Feb 6, 2024
2 parents 2205a76 + 04bcc19 commit bf931cf
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/idcindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import tempfile
import unittest

import pytest
from idc_index import index

# Run tests using the following command from the root of the repository:
Expand All @@ -13,6 +14,11 @@
logging.basicConfig(level=logging.INFO)


@pytest.fixture(autouse=True)
def _change_test_dir(request, monkeypatch):
monkeypatch.chdir(request.fspath.dirname)


class TestIDCClient(unittest.TestCase):
def setUp(self):
self.client = index.IDCClient()
Expand Down Expand Up @@ -92,15 +98,15 @@ def test_sql_queries(self):
def test_download_from_aws_manifest(self):
with tempfile.TemporaryDirectory() as temp_dir:
self.client.download_from_manifest(
manifestFile="./tests/study_manifest_aws.s5cmd", downloadDir=temp_dir
manifestFile="./study_manifest_aws.s5cmd", downloadDir=temp_dir
)

self.assertEqual(len(os.listdir(temp_dir)), 15)

def test_download_from_gcp_manifest(self):
with tempfile.TemporaryDirectory() as temp_dir:
self.client.download_from_manifest(
manifestFile="./tests/study_manifest_gcs.s5cmd", downloadDir=temp_dir
manifestFile="./study_manifest_gcs.s5cmd", downloadDir=temp_dir
)

self.assertEqual(len(os.listdir(temp_dir)), 15)
Expand Down

0 comments on commit bf931cf

Please sign in to comment.