Skip to content

Commit

Permalink
Add fixes to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
amrit110 committed Oct 6, 2023
1 parent 12e6e8b commit a93f989
Show file tree
Hide file tree
Showing 7 changed files with 1,432 additions and 1,283 deletions.
2,666 changes: 1,390 additions & 1,276 deletions poetry.lock

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion tests/cyclops/query/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@
@pytest.mark.integration_test()
def test_dataset_querier():
"""Test base querier methods using OMOPQuerier."""
querier = OMOPQuerier("cdm_synthea10", database="synthea_integration_test")
querier = OMOPQuerier(
database="synthea_integration_test",
schema_name="cdm_synthea10",
user="postgres",
password="pwd",
)
assert len(querier.list_tables()) == 69
assert len(querier.list_schemas()) == 4
assert len(querier.list_tables(schema_name="cdm_synthea10")) == 43
Expand Down
7 changes: 6 additions & 1 deletion tests/cyclops/query/test_eicu.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@
@pytest.mark.integration_test()
def test_eicu_querier():
"""Test EICUQuerier on eICU-CRD."""
querier = EICUQuerier(database="eicu")
querier = EICUQuerier(
database="eicu",
user="postgres",
password="pwd",
)

patients = querier.eicu_crd.patient().run(limit=10)
assert len(patients) == 10
assert "age" in patients
Expand Down
7 changes: 6 additions & 1 deletion tests/cyclops/query/test_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,12 @@ def test_query_interface(
@pytest.mark.integration_test()
def test_query_interface_integration():
"""Test QueryInterface with OMOPQuerier."""
synthea = OMOPQuerier("cdm_synthea10", database="synthea_integration_test")
synthea = OMOPQuerier(
database="synthea_integration_test",
schema_name="cdm_synthea10",
user="postgres",
password="pwd",
)
visits = synthea.visit_occurrence()
assert isinstance(visits, QueryInterface)
visits_pd_df = visits.run()
Expand Down
7 changes: 6 additions & 1 deletion tests/cyclops/query/test_mimiciv.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@
@pytest.mark.integration_test()
def test_mimiciv_querier():
"""Test MIMICQuerier on MIMICIV-2.0."""
querier = MIMICIVQuerier()
querier = MIMICIVQuerier(
database="mimiciv-2.0",
user="postgres",
password="pwd",
)

patients = querier.patients().run(limit=10)
assert len(patients) == 10
assert "anchor_year_difference" in patients
Expand Down
14 changes: 12 additions & 2 deletions tests/cyclops/query/test_omop.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@
@pytest.mark.integration_test()
def test_omop_querier_synthea():
"""Test OMOPQuerier on synthea data."""
querier = OMOPQuerier("cdm_synthea10", database="synthea_integration_test")
querier = OMOPQuerier(
database="synthea_integration_test",
schema_name="cdm_synthea10",
user="postgres",
password="pwd",
)
ops = qo.Sequential(
qo.ConditionEquals("gender_source_value", "M"),
qo.Rename({"race_source_value": "race"}),
Expand All @@ -36,6 +41,11 @@ def test_omop_querier_synthea():
@pytest.mark.integration_test()
def test_omop_querier_mimiciii():
"""Test OMOPQuerier on MIMICIII data."""
querier = OMOPQuerier("omop", database="mimiciii")
querier = OMOPQuerier(
database="mimiciii",
schema_name="omop",
user="postgres",
password="pwd",
)
visits = querier.visit_occurrence().run()
assert len(visits) == 58976
7 changes: 6 additions & 1 deletion tests/cyclops/query/test_orm.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@
@pytest.mark.integration_test()
def test_omop_querier():
"""Test ORM using OMOPQuerier."""
querier = OMOPQuerier("cdm_synthea10", database="synthea_integration_test")
querier = OMOPQuerier(
database="synthea_integration_test",
schema_name="cdm_synthea10",
user="postgres",
password="pwd",
)
assert querier is not None
db_ = querier.db
visits_query = querier.visit_occurrence().query
Expand Down

0 comments on commit a93f989

Please sign in to comment.