Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nebfield committed Sep 11, 2023
1 parent 68c6165 commit 8cddbc7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pgscatalog_utils/download/download_scorefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def download_scorefile() -> None:
f"Setting user agent to {config.PGSC_CALC_VERSION} for PGS Catalog API queries")
else:
config.PGSC_CALC_VERSION = f"pgscatalog_utils/{version}"
logger.warn(f"No user agent set, defaulting to {config.PGSC_CALC_VERSION}")
logger.warning(f"No user agent set, defaulting to {config.PGSC_CALC_VERSION}")

config.OUTDIR = pathlib.Path(args.outdir).resolve()
logger.info(f"Download directory: {config.OUTDIR}")
Expand Down
2 changes: 1 addition & 1 deletion tests/test_combine.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def test_fail_combine(scorefiles, tmp_path_factory):

@pytest.fixture
def _n_variants(pgs_accessions):
result = CatalogQuery(CatalogCategory.SCORE, accession=pgs_accessions, pgsc_calc_version=None).get()[0]
result = CatalogQuery(CatalogCategory.SCORE, accession=pgs_accessions).get()[0]
json = result.response
n: list[int] = jq.compile("[.results][][].variants_number").input(json).all()
return sum(n)
6 changes: 2 additions & 4 deletions tests/test_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,11 @@ def test_download_trait(tmp_path):

def test_query_publication():
# publications are relatively static
query: list[CatalogResult] = CatalogQuery(CatalogCategory.PUBLICATION, accession="PGP000001",
pgsc_calc_version=None).get()
query: list[CatalogResult] = CatalogQuery(CatalogCategory.PUBLICATION, accession="PGP000001").get()
assert not query[0].pgs_ids.difference({'PGS000001', 'PGS000002', 'PGS000003'})


def test_query_trait():
# new scores may be added to traits in the future
query: list[CatalogResult] = CatalogQuery(CatalogCategory.TRAIT, accession="EFO_0004329",
pgsc_calc_version=None).get()
query: list[CatalogResult] = CatalogQuery(CatalogCategory.TRAIT, accession="EFO_0004329").get()
assert not {'PGS001901', 'PGS002115'}.difference(query[0].pgs_ids)

0 comments on commit 8cddbc7

Please sign in to comment.