← Về thư mục
tests/primekg/test_scripts.py
- PrimeKgTestCase · class · L42-L52 — class PrimeKgTestCase(unittest.TestCase)
- setUp · method · L45-L52 — def setUp(self) -> None
- DataPathTests · class · L55-L73 — class DataPathTests(unittest.TestCase)
- test_the_default_path_is_relative_and_env_overridable · method · L56-L65 — def test_the_default_path_is_relative_and_env_overridable(self) -> None: # A hardcoded absolute path would name one machine and work on no other.
- test_a_missing_file_explains_where_to_get_the_data · method · L67-L73 — def test_a_missing_file_explains_where_to_get_the_data(self) -> None
- SearchTests · class · L76-L105 — class SearchTests(PrimeKgTestCase)
- test_nodes_are_found_on_either_side_of_an_edge · method · L77-L85 — def test_nodes_are_found_on_either_side_of_an_edge(self) -> None: # TP53 appears as x in one row and as y in another; one record either way.
- test_search_is_case_insensitive_and_substring_based · method · L87-L91 — def test_search_is_case_insensitive_and_substring_based(self) -> None
- test_a_type_filter_narrows_the_result · method · L93-L99 — def test_a_type_filter_narrows_the_result(self) -> None: # "Breast" matches both the disease and the phenotype.
- test_no_match_returns_an_empty_list · method · L101-L102 — def test_no_match_returns_an_empty_list(self) -> None
- test_results_carry_the_source_database · method · L104-L105 — def test_results_carry_the_source_database(self) -> None
- NeighborTests · class · L108-L130 — class NeighborTests(PrimeKgTestCase)
- test_neighbors_are_collected_from_both_directions · method · L109-L113 — def test_neighbors_are_collected_from_both_directions(self) -> None: # BRCA1 is only ever a y-node, so a one-sided query would return none.
- test_a_node_id_is_matched_as_a_string_or_a_number · method · L115-L119 — def test_a_node_id_is_matched_as_a_string_or_a_number(self) -> None
- test_a_relation_filter_restricts_the_edge_type · method · L121-L123 — def test_a_relation_filter_restricts_the_edge_type(self) -> None
- test_the_display_relation_is_carried_through · method · L125-L127 — def test_the_display_relation_is_carried_through(self) -> None
- test_an_unknown_node_has_no_neighbors · method · L129-L130 — def test_an_unknown_node_has_no_neighbors(self) -> None
- PathTests · class · L133-L152 — class PathTests(PrimeKgTestCase)
- test_a_direct_edge_is_returned_as_a_one_hop_path · method · L134-L138 — def test_a_direct_edge_is_returned_as_a_one_hop_path(self) -> None
- test_direction_does_not_matter · method · L140-L144 — def test_direction_does_not_matter(self) -> None
- test_unconnected_nodes_yield_no_path · method · L146-L147 — def test_unconnected_nodes_yield_no_path(self) -> None
- test_two_hop_search_is_documented_as_unimplemented · method · L149-L152 — def test_two_hop_search_is_documented_as_unimplemented(self) -> None: # The depth-2 branch is a stub; assert the current contract rather than # a capability the script does not have.
- DiseaseContextTests · class · L155-L184 — class DiseaseContextTests(PrimeKgTestCase)
- test_the_context_is_bucketed_by_neighbour_type · method · L156-L168 — def test_the_context_is_bucketed_by_neighbour_type(self) -> None
- test_a_disease_with_no_drug_edges_reports_an_empty_bucket · method · L170-L172 — def test_a_disease_with_no_drug_edges_reports_an_empty_bucket(self) -> None
- test_an_unknown_disease_reports_an_error_rather_than_raising · method · L174-L178 — def test_an_unknown_disease_reports_an_error_rather_than_raising(self) -> None
- test_a_gene_name_is_not_mistaken_for_a_disease · method · L180-L184 — def test_a_gene_name_is_not_mistaken_for_a_disease(self) -> None: # search_nodes is type-filtered to 'disease', so a gene must not match.