aboutsummaryrefslogtreecommitdiff
path: root/tests/unit/db
AgeCommit message (Collapse)Author
2024-10-02Spin up a local virtuoso instance to run RDF tests against.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-10-02Set a default password for sparql.Munyoki Kilyungi
* tests/fixtures/rdf.py: Import config. (get_sparql_auth_conf): Load GN3 config from GN3_SECRETS and GN3_CONF if the respective envs are set. Set sane defaults for sparql_conf. (rdf_setup): Remove "fxtr_app_config". * tests/unit/db/rdf/test_wiki.py (test_get_wiki_entries_by_symbol): Ditto. (test_get_comment_history): Ditto. (test_update_wiki_comment): Ditto. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-09-28Lint: fix some linting errors.Frederick Muriuki Muriithi
2024-09-27Use existing fixture to retrieve settings.Frederick Muriuki Muriithi
2024-09-23Revert "Add pytest.mark.unit_test for all rdf test-cases."Munyoki Kilyungi
This reverts commit f6d9b0cfb842b53e8777e9918549f1ed1ee5892e. Failing tests because of how we run tests using guix. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-09-23Add pytest.mark.unit_test for all rdf test-cases.Munyoki Kilyungi
This makes sure that all the test correctly run in CD. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-09-23Fix or ignore pylint errors.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-09-23Remove dead comment.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-09-23Use test fixtures to set-up a test named graph.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-09-23Add RDF test cases.Munyoki Kilyungi
* pytest.ini: Add rdf pytest marker. * tests/test_data/ttl-files/test-data.ttl: New file with turtle test data for RIF editing. * tests/unit/db/rdf/test_wiki.py (test_sanitize_result): New test case. (test_get_comment_history): Ditto. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-09-11Add test cases for wiki.__sanitize_result.Munyoki Kilyungi
* tests/unit/db/rdf/test_wiki.py (test_sanitize_result): New file. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-09-05Remove un-necessary string concatenationMunyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-09-05Replace "escape_string" with safe-query parametersMunyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-08-17Fix tests to work with changeszsloan
2023-08-04Remove unused importFrederick Muriuki Muriithi
2023-08-04Remove tests for deleted function.Frederick Muriuki Muriithi
2023-08-02Remove ORM-dependent `insert` functionFrederick Muriuki Muriithi
Remove the object-relation-mapping dependent `insert` function to prevent it being used in the code down the line.
2023-08-02Remove ORM-dependent `fetchall` and `fetchone` functionsFrederick Muriuki Muriithi
Remove Object-Relational Mapping dependent function, `fetchall` and `fetchone` so as to prevent theirs use in the code moving forward.
2023-07-19Extract code dealing with ProbeSets to their own module.Frederick Muriuki Muriithi
2023-07-11Revert "Skip tests broken by Python-3.10 temporarily"Frederick Muriuki Muriithi
This reverts commit f52247c15f3694f3dd5fd0fd79c3e15376137e07.
2023-07-05Skip tests broken by Python-3.10 temporarilyFrederick Muriuki Muriithi
Skip the tests that have been broken by the migrations to Python-3.10 temporarily, until we can fix them.
2023-03-20Fix get_all_species testzsloan
2022-05-27Move sql for CRUD operations on case-attrs from gn2 to gn3BonfaceKilz
2022-05-27Move sql for modifying case-attributes from gn2 to gn3BonfaceKilz
2022-05-27Return all the results from CaseAttributes column as isBonfaceKilz
* gn3/db/sample_data.py: Remove "collections" import. Add "Optional" import. (get_case_attributes): Return the results of "fetchall" from the case attributes. * tests/unit/db/test_sample_data.py (test_get_case_attributes): Update failing test.
2022-05-26Add Endpoint to get menu items for use in UIFrederick Muriuki Muriithi
2022-04-12Test that a carriage return is removed when generating csvBonfaceKilz
* tests/unit/db/test_sample_data.py: import "get_trait_csv_sample_data". (test_get_trait_csv_sample_data): New test function.
2022-04-07Use case attribute id inside brackets if present during insertionsBonfaceKilz
* gn3/db/sample_data.py (delete_sample_data): If an id is present in the column header, use it. * tests/unit/db/test_sample_data.py (test_delete_sample_data): Update tests to capture the above.
2022-04-07Use case attribute id inside brackets if present during insertionsBonfaceKilz
* gn3/db/sample_data.py (insert_sample_data): If an id is present in the column header, use it. * tests/unit/db/test_sample_data.py (test_insert_sample_data): Update tests to capture the above.
2022-04-07Use case attribute id inside brackets if present during updatesBonfaceKilz
* gn3/db/sample_data.py: Import "parse_csv_column". (update_sample_data): If an id is present in the column header, use it. * tests/unit/db/test_sample_data.py (test_update_sample_data): Update tests to capture the above.
2022-04-07Add method for fetching the case_attributesBonfaceKilz
* gn3/db/sample_data.py (get_case_attributes): New function. * tests/unit/db/test_sample_data.py (test_get_case_attributes): Test case for the above.
2022-04-01Run python-black in fileBonfaceKilz
* gn3/csvcmp.py: Run "black -l 79 ..." * tests/unit/db/test_sample_data.py: Ditto. * tests/unit/test_csvcmp.py: Ditto.
2022-03-12Fix pylint errors in unit_testsBonfaceKilz
2022-03-12Append the strain name when extracting "actions"BonfaceKilz
* gn3/db/sample_data.py (__extract_actions): During updates, make sure that the strain name is part of the returned string when extracting "actions". * tests/unit/db/test_sample_data.py: Add test cases for the above.
2022-03-12Apply auto-pep8 to sample_data.py and it's test fileBonfaceKilz
2022-03-12Update how data is updated by re-using existing functionsBonfaceKilz
* gn3/db/sample_data.py (get_sample_data_ids): Re-use "delete_sample_data" and "insert_sample_data" when updating data; and also add logic for updating modified data. * tests/unit/db/test_sample_data.py: Add tests for the above.
2022-03-12Create action dict that's created when updating dataBonfaceKilz
* gn3/db/sample_data.py (__extract_actions): An update on a vector of data can contain: inserts, deletes and updates. This functions extracts these actions during an update. * tests/unit/db/test_sample_data.py (test_extract_actions): Add test-case for the above.
2022-03-12Add test cases for inserting and deleting dataBonfaceKilz
* tests/unit/db/test_sample_data.py (test_insert_sample_data): Test inserting data. (test_delete_sample_data): Test deleting data.
2022-03-12Remove test cases related to sample dataBonfaceKilz
Most of this functions were moved to their own module.
2022-03-12Append case attributes to csv data if they existBonfaceKilz
2022-02-21Fix minor issues introduced while fixing linting errorsFrederick Muriuki Muriithi
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-21Add test to ensure samples are read correctly from .geno filesFrederick Muriuki Muriithi
* tests/unit/db/test_genotypes2.py: New file
2022-02-18Remove erroneous test based on wrong assumptionsFrederick Muriuki Muriithi
Related to commit 75dcfe295af57b16428c586cc11dbaa827a5feba This commit removes the related test that was checking for the wrong thing.
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
2022-02-09Remove obsolete `PublishFreeze` tableFrederick Muriuki Muriithi
2022-01-05test_traits.py: Update failing testBonfaceKilz
2021-12-14Provide expected values to use for testsFrederick Muriuki Muriithi
2021-11-23Fix a myriad of linting errorsFrederick Muriuki Muriithi
* Fix linting errors like: - Unused variables - Undeclared variable errors (mostly caused by typos, and wrong names) - Missing documentation strings for functions etc.
2021-11-22Add test to query buildersFrederick Muriuki Muriithi
Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * Add some tests for the query builders to ensure that the queries are built up correctly.