aboutsummaryrefslogtreecommitdiff
path: root/wqflask/tests
AgeCommit message (Expand)Author
2023-03-20Disable editing case-attributes...ATM, editing case-attributes is very buggy. * wqflask/tests/integration/wqflask/test_metadata_edits.py: Delete. * wqflask/wqflask/decorators.py: Remove: gn3.authentication.get_groups_by_user_uid import. (case_attributes_edit_access): Delete. * wqflask/tests/integration/wqflask/test_metadata_edits.py: Remove wqflask.decorators.case_attributes_edit_access, gn3.db.case_attributes.get_case_attributes, gn3.db.case_attributes.get_unreviewed_diffs, gn3.db.case_attributes.insert_case_attribute_audit, gn3.db.case_attributes.reject_case_attribute and gn3.db.case_attributes.approve_case_attribute. (display_phenotype_metadata): Remove headers arg when rendering template. (update_phenotype): Remove case attribute headers list when updating a phenotype. (show_case_attribute_columns, update_case_attributes): Delete. (reject_case_attribute_data, approve_case_attribute_data): Ditto. * wqflask/wqflask/templates/edit_phenotype.html: Remove link that shows all the listed case-attributes. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com> Munyoki Kilyungi
2022-12-01Reproduce ValueError when query_sql returns None...* wqflask/tests/unit/base/test_data_set.py (TestDatasetAccessionId): New test cases. Munyoki Kilyungi
2022-12-01Delete complicated unmaintainable test-cases marked for skipping...* wqflask/tests/unit/base/test_data_set.py (TestDataSetTypes) [test_set_dataset_key_mrna, test_set_dataset_key_pheno, test_set_dataset_geno]: Delete. Munyoki Kilyungi
2022-10-28Refactor: Pass user id to `check_resource_availability`...* Pass the user_id for the current user to the `check_resource_availability` function as an argument, rather than using the global `g.user_session.user_id` value. Frederick Muriuki Muriithi
2022-10-23Inlcude redis_conn in MockGroup for get_samplelistzsloan
2022-10-20Clean Up: Remove unused function...* The function `generate_corr_json` was not used anywhere in the code. Frederick Muriuki Muriithi
2022-10-14Update mock: Return correct test data.Frederick Muriuki Muriithi
2022-09-27Unit Test: Fix unit test for Chromosome functions.Frederick Muriuki Muriithi
2022-09-22Provide database cursor as argument for TheSpecies and Chromosomes...Provide the database cursor as an argument to the methods of the two classes: * wqflask.base.species.TheSpecies * wqflask.base.species.Chromosomes Also update dependent code to initialise and pass the cursor where these classes are used. Frederick Muriuki Muriithi
2022-09-22Update tests: pass in missing arguments.Frederick Muriuki Muriithi
2022-09-20Decompose file into separate modules...To ease future refactors on the code, decompose the file into a module with multiple modules that can be refactored semi-independently. refactor-data_set_py-20220920Frederick Muriuki Muriithi
2022-09-19Provide fixtures for test. Fix error to pass test....Provide the following (empty) files to be used for the test * wqflask/tests/unit/wqflask/marker_regression/genotype/bimbam/file_geno.txt * wqflask/tests/unit/wqflask/marker_regression/genotype/bimbam/file_snps.txt Rework the paths in `wqflask/tests/unit/wqflask/marker_regression/test_gemma_mapping.py` such that they point to the files added above for testing. Do not require that the phenotype file exists in `wqflask/wqflask/marker_regression/gemma_mapping.py` before attempting the mapping. Frederick Muriuki Muriithi
2022-09-19Remove "wrong" assertions...The assertions was checking that the function was implemented a certain way, rather than whether the function was doing the correct thing. Frederick Muriuki Muriithi
2022-09-09Refactor: Add tests and handle edge case...Remove mutation of state, and handle the edge case where the sub-sequence could be an empty sequence. Frederick Muriuki Muriithi
2022-09-08Test the creation of the_species, indchromosomes and chromosome objs...* wqflask/tests/unit/base/test_species.py (TestTheSpecies): Delete. (TestIndChromosome): Move to pytest and parametrize. (TestChromosomes): Ditto. (test_species): Ditto. (test_create_ind_chromosome): Ditto. (test_create_chromosomes): Ditto. Munyoki Kilyungi
2022-09-08Use "%s" in sql query...* wqflask/base/mrna_assay_tissue_data.py: Delete db_tools. (MrnaAssayTissueData.get_symbol_values_pairs): Re-format query. * wqflask/tests/unit/base/test_mrna_assay_tissue_data.py: (test_get_trait_symbol_and_tissue_values): Add test for above. Munyoki Kilyungi
2022-09-08Move test case to mrna_assay_tissue_data test module...* wqflask/tests/unit/base/test_mrna_assay_tissue_data.py * wqflask/tests/unit/wqflask/correlation/test_correlation_functions.py (TestCorrelationFunctions.test_tissue_corr_computation): Delete. (TestCorrelationFunctions): Move this ... (test_mrna_assay_tissue_data_initialisation): ... here Munyoki Kilyungi
2022-09-08Inject database connection to mrna_assay_tissue_data class...* wqflask/base/mrna_assay_tissue_data.py: Imports: Delete database_connection, escape, and database_connector. (MrnaAssayTissueData): Inject conn. Re-format queries. Rework 'if ... else' logic. Re-work how results are assigned to 'self.data[symbol]' - remove dot-notation. (MrnaAssayTissueData.get_symbol_values_pairs): Move box-comments to doc-string. Rework how results are assigned to 'symbol_values_dict' - remove dot-notation. * wqflask/tests/unit/base/test_mrna_assay_tissue_data.py (test_mrna_assay_tissue_data_initialisation): New test. * wqflask/wqflask/correlation/correlation_functions.py: Import database_connection. (get_trait_symbol_and_tissue_values): Inject conn object. Munyoki Kilyungi
2022-09-08Rewrite "test_tissue_corr_computation" as a pytest...* wqflask/tests/unit/wqflask/correlation/test_correlation_functions.py (TestCorrelationFunctions): Convert this unittest class to ... (test_tissue_corr_computation): ... a pytest function. Munyoki Kilyungi
2022-09-08Replace "g.db" mocks with "database_connection" mocks...* wqflask/tests/unit/base/test_trait.py: Delete "wqflask.app" import. (TestRetrieveTraitInfo.setUp): Delete it. (TestRetrieveTraitInfo.tearDown): Ditto. (TestRetrieveTraitInfo.test_retrieve_trait_info_with_empty_dataset): Replace "g" mock with "database_connection" mock. (test_retrieve_trait_info_with_empty_trait_info): Ditto. (test_retrieve_trait_info_with_non_empty_trait_info): Ditto. (test_retrieve_trait_info_utf8_parsing): Ditto. * wqflask/tests/wqflask/show_trait/test_show_trait.py (TestTraits): (test_get_nearest_marker): Ditto. (test_get_nearest_marker_empty_db): Ditto. Munyoki Kilyungi
2022-09-08Adjust expected table width...* wqflask/tests/wqflask/show_trait/test_show_trait.py (TestTraits.test_get_table_widths): Use new values for the table width to make the tests pass. Munyoki Kilyungi
2022-09-08Condense test-cases for "get_ncbi_summary_request" into one test...* wqflask/tests/wqflask/show_trait/test_show_trait.py: (TestTraits.test_get_ncbi_summary_request_success): Condense this ... (TestTraits.test_get_ncbi_summary_request): ... and this ... (test_get_ncbi_summary_request): ... here. Munyoki Kilyungi
2022-09-08Parametrize test cases for "check_if_attr_exists"...* wqflask/tests/wqflask/show_trait/test_show_trait.py: Import pytest. (TestTraits.test_check_if_attr_exists_truthy): Delete it. (TestTraits.test_check_if_attr_exists_empty_attr): Ditto. (TestTraits.test_check_if_attr_exists_falsey): Ditto. (TestTraits.test_check_if_attr_exists_falsey): Ditto. test_check_if_attr_exists: Add new parametrized test case to test "check_if_attr_exists". Munyoki Kilyungi
2022-09-08Add extra distinct_values and id attributes to test TraitObject...* wqflask/tests/wqflask/show_trait/test_show_trait.py (TraitObject): Add self.id and self.distinct_values. Munyoki Kilyungi
2022-09-08Remove app initialisation in test...* wqflask/tests/wqflask/show_trait/test_show_trait.py: Delete "wqflask.app" import. (TestTraits.setUp): Delete it. (TestTraits.tearDown): Ditto. Munyoki Kilyungi
2022-09-08Move data.gen_menu_json to test_data_set.py...This is done to avoid relative imports. wqflask/tests/unit/base/data.py: Delete it. * wqflask/tests/unit/base/test_data_set.py: Add new variable GEN_MENU_JSON. (TestDataSetTypes.test_data_set_type_with_empty_redis): Upper-case "gen_menu_json" variable. Munyoki Kilyungi
2022-09-08Delete dead imports...* wqflask/base/data_set.py: Remove un-used imports. * wqflask/base/trait.py: Ditto. wqflask/tests/wqflask/show_trait/test_show_trait.py: Ditto. * wqflask/wqflask/show_trait/show_trait.py: Ditto. * wqflask/wqflask/views: Ditto. Munyoki Kilyungi
2022-09-05Update values for "additive" in failing gemma test...* wqflask/tests/unit/wqflask/marker_regression/test_gemma_mapping.py (TestGemmaMapping.test_parse_loco_outputfile_found): Use a halved value in expected_results["additive"]. Munyoki Kilyungi
2022-08-31Add transform parameter to mapping api unit testzsloan
2022-08-31Fix failing api/test_mapping.py testzsloan
2022-08-08remove unnessary append to listAlexander_Kabui
2022-08-08remove test;test is redundantAlexander_Kabui
2022-08-08tests refactoringAlexander_Kabui
2022-06-10Skip failing integration test...ATM, it's hard to by-pass the authentication decorators, and as such, skip this test for. This may be deleted later. BonfaceKilz
2022-06-10Reverse polarity for gemma additive effects in tests...Fixes broken test. See: #89a7868. BonfaceKilz
2022-04-14wqflask: Mock db connection when fetching case attributes...* wqflask/tests/integration/wqflask/test_metadata_edits.py (test_show_case_attributes): Mock "database_connection". Fixes this failing test: <https://ci.genenetwork.org/jobs/genenetwork2/223> BonfaceKilz
2022-04-07Create a new page to display case-attributes and their descriptions...* wqflask/wqflask/metadata_edits.py: Import "gn3.db.sample_data.get_case_attributes". (show_case_attribute_columns): New function/ end-point to show case-attributes. * wqflask/tests/integration/wqflask/test_metadata_edits.py: New integration tests for the above. * wqflask/tests/integration/wqflask/__init__.py: New file. * wqflask/wqflask/templates/case_attributes.html: New template file to display the above. BonfaceKilz
2022-03-22Merge remote-tracking branch 'origin/testing' into feature/add_rqtl_pairscanzsloan
2022-03-17Lint some test filesBonfaceKilz
2022-03-17Fix failing testBonfaceKilz
2022-03-17Skip unittests...These tests touch on core data-structures in gn2; and there's a chance that refactoring said data-structures may break many things. BonfaceKilz
2022-03-17Replace "g.db" object with a proper database connection...* wqflask/tests/unit/wqflask/api/test_correlation.py: Use proper database connection instead of the db connection attached at "g.db". * wqflask/tests/unit/wqflask/snp_browser/test_snp_browser.py: Ditto. * wqflask/wqflask/api/correlation.py: Ditto. * wqflask/wqflask/snp_browser/snp_browser.py: Ditto. BonfaceKilz
2022-01-14Merge branch 'testing' of github.com:genenetwork/genenetwork2 into feature/ad...zsloan
2021-11-04use gn3 importsBonfaceKilz
2021-10-25Update failing tests when testing `get_user_access_roles`BonfaceKilz
2021-10-25Replace "resource_id" with "resource_info" dict...This avoids calling Redis twice when fetching metadata about the resource. BonfaceKilz
2021-10-25Get a users access mask...If a user has several access roles, select the highest role. BonfaceKilz
2021-10-25Add test-cases for `get_user_membership`BonfaceKilz
2021-10-25Move markdown_routes to api/markdown...All new API definitions should be migrated to "wqflask/ api" BonfaceKilz
2021-10-13resolve merge conflictAlexander Kabui