-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
38 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import pytest | ||
|
||
@pytest.fixture | ||
def pyomop_fixture(): | ||
from src.pyomop import CdmEngineFactory | ||
cdm = CdmEngineFactory() | ||
return cdm | ||
|
||
@pytest.fixture | ||
def metadata_fixture(): | ||
from src.pyomop import metadata | ||
return metadata | ||
|
||
def test_create_db(pyomop_fixture, metadata_fixture, capsys): | ||
import datetime | ||
from sqlalchemy.sql import select | ||
engine = pyomop_fixture.engine | ||
metadata_fixture.create_all(engine) | ||
Cohort = pyomop_fixture.base.cohort | ||
session = pyomop_fixture.session | ||
session.add(Cohort(cohort_definition_id=2, subject_id=100, | ||
cohort_end_date=datetime.datetime.now(), | ||
cohort_start_date=datetime.datetime.now())) | ||
session.commit() | ||
|
||
s = select([Cohort]) | ||
result = session.execute(s) | ||
for row in result: | ||
print(row) | ||
assert row['subject_id'] == 100 |
This file was deleted.
Oops, something went wrong.