aboutsummaryrefslogtreecommitdiff
path: root/tests/unit/test_db_utils.py
AgeCommit message (Collapse)Author
2022-03-26Make creation of database connections more flexibleFrederick Muriuki Muriithi
* Pass the URI string to parse into `gn3.db_utils.parse_db_url` rather than relying on a global variable. * Pass the URI string to use to generate the database connection to the `gn3.db_utils.database_connector` function rather than depending on a global variable. Use the global `SQL_URI` variable as a default value if one is not provided when calling the function. The changes above make the creation of the database connection more flexible, since the database URI passed into the function can be changed at the site where the call is made. The port is also parsed, and used where present, to allow for either a socket connection or one based on a port.
2022-03-11Fix some linting issuesFrederick Muriuki Muriithi
2022-03-08Fix tests, and issues caught by testsFrederick Muriuki Muriithi
Fix some issues caught by tests due to changes introducing the hand-off of the partial correlations computations to an external process Fix some issues due to the changes that introduce context managers for database connections Update some tests to take the above two changes into consideration
2022-02-21Fix a myriad of linter issuesFrederick Muriuki Muriithi
* Use `with` in place of plain `open` * Use f-strings in place of `str.format()` * Remove string interpolation from queries - provide data as query parameters * other minor fixes
2022-02-17Use pytest's "mark" feature to categorise testsFrederick Muriuki Muriithi
Use pytest's `mark` feature to explicitly categorise the tests and run them per category
2021-04-12Integrate correlation APIAlexander Kabui
- add new api for gn2-gn3 sample r integration - delete map for sample list to values - add db util file - add python msql-client dependency - add db for fetching lit correlation results - add unittests for db utils - add tests for db_utils - modify api for fetching lit correlation results - refactor Mock Database Connector and unittests - add sql url parser - add SQL URI env variable - refactor code for db utils - modify return data for lit correlation - refactor tissue correlation endpoint - replace db_instance with conn