← Về thư mục
tests/pathogen-variant-surveillance/test_scripts.py
- _load_script · function · L30-L39 — def _load_script(name: str)
- schema · function · L49-L69 — def schema(**overrides) -> dict
- FieldResolutionTests · class · L93-L127 — class FieldResolutionTests(unittest.TestCase)
- test_collection_date_differs_between_instances · method · L96-L101 — def test_collection_date_differs_between_instances(self)
- test_string_typed_date_is_rejected_not_guessed · method · L103-L108 — def test_string_typed_date_is_rejected_not_guessed(self): # H5N1 types sampleCollectionDate as a string, so LAPIS offers no range # filter for it at all. Silently substituting one would be worse.
- test_submission_date_differs_between_instances · method · L110-L114 — def test_submission_date_differs_between_instances(self)
- test_missing_date_field_raises_with_the_alternatives · method · L116-L119 — def test_missing_date_field_raises_with_the_alternatives(self)
- test_supports_range_follows_declared_type · method · L121-L124 — def test_supports_range_follows_declared_type(self)
- test_range_keys · method · L126-L127 — def test_range_keys(self)
- LineageFieldTests · class · L130-L157 — class LineageFieldTests(unittest.TestCase)
- test_indexed_column_preferred · method · L131-L132 — def test_indexed_column_preferred(self)
- test_unindexed_instance_reports_no_index · method · L134-L135 — def test_unindexed_instance_reports_no_index(self)
- test_qc_columns_are_not_lineage_columns · method · L137-L141 — def test_qc_columns_are_not_lineage_columns(self): # "nextcladeQcOverallScore" contains "clade" and must not be offered.
- test_per_segment_columns_excluded · method · L143-L146 — def test_per_segment_columns_excluded(self)
- test_ha_clade_outranks_na_clade · method · L148-L153 — def test_ha_clade_outranks_na_clade(self)
- test_no_lineage_column_raises · method · L155-L157 — def test_no_lineage_column_raises(self)
- LineageFilterTests · class · L160-L182 — class LineageFilterTests(unittest.TestCase)
- test_bare_name_stays_exact · method · L163-L164 — def test_bare_name_stays_exact(self)
- test_sublineages_expand_on_an_indexed_column · method · L166-L168 — def test_sublineages_expand_on_an_indexed_column(self)
- test_sublineages_refused_without_an_index · method · L170-L175 — def test_sublineages_refused_without_an_index(self): # On H5N1 'clade=2.3.4.4b*' returns 0 rather than an error, so building # the query at all is the bug.
- test_trailing_star_refused_without_an_index · method · L177-L179 — def test_trailing_star_refused_without_an_index(self)
- test_exact_query_still_allowed_without_an_index · method · L181-L182 — def test_exact_query_still_allowed_without_an_index(self)
- WilsonIntervalTests · class · L185-L209 — class WilsonIntervalTests(unittest.TestCase)
- test_zero_successes_has_nonzero_upper_bound · method · L186-L190 — def test_zero_successes_has_nonzero_upper_bound(self)
- test_interval_stays_inside_the_unit_interval · method · L192-L196 — def test_interval_stays_inside_the_unit_interval(self)
- test_interval_brackets_the_estimate · method · L198-L201 — def test_interval_brackets_the_estimate(self)
- test_interval_narrows_with_n · method · L203-L206 — def test_interval_narrows_with_n(self)
- test_empty_denominator_is_maximally_uncertain · method · L208-L209 — def test_empty_denominator_is_maximally_uncertain(self)
- _sxx · function · L212-L220 — def _sxx(points) -> float
- LogitSlopeTests · class · L223-L285 — class LogitSlopeTests(unittest.TestCase)
- test_rising_series_has_positive_slope · method · L224-L229 — def test_rising_series_has_positive_slope(self)
- test_falling_series_has_negative_slope · method · L231-L235 — def test_falling_series_has_negative_slope(self)
- test_flat_series_slope_near_zero · method · L237-L241 — def test_flat_series_slope_near_zero(self)
- test_all_zero_observations_returns_no_fit · method · L243-L248 — def test_all_zero_observations_returns_no_fit(self): # Regression: with only the continuity correction, a shrinking # denominator manufactured a tight positive slope (+0.105/week, CI # excluding zero) for a lineage observed zero times in every week.
- test_too_few_successes_returns_no_fit · method · L250-L252 — def test_too_few_successes_returns_no_fit(self)
- test_too_few_nonzero_weeks_returns_no_fit · method · L254-L256 — def test_too_few_nonzero_weeks_returns_no_fit(self)
- test_too_few_points_returns_no_fit · method · L258-L259 — def test_too_few_points_returns_no_fit(self)
- test_dispersion_never_shrinks_the_interval_below_binomial · method · L261-L269 — def test_dispersion_never_shrinks_the_interval_below_binomial(self): # A short, near-perfect series estimates dispersion < 1. Letting that # through would report a CI narrower than binomial sampling allows.
- test_overdispersion_widens_the_interval · method · L271-L278 — def test_overdispersion_widens_the_interval(self)
- test_empty_weeks_are_dropped_not_counted · method · L280-L285 — def test_empty_weeks_are_dropped_not_counted(self)
- WeekBinningTests · class · L288-L313 — class WeekBinningTests(unittest.TestCase)
- test_iso_week_start_is_monday · method · L289-L292 — def test_iso_week_start_is_monday(self)
- test_partial_and_null_dates_are_unparseable · method · L294-L296 — def test_partial_and_null_dates_are_unparseable(self)
- test_undated_rows_are_counted_separately · method · L298-L307 — def test_undated_rows_are_counted_separately(self)
- test_week_range_is_inclusive_and_gapless · method · L309-L313 — def test_week_range_is_inclusive_and_gapless(self)
- CoverageFlagTests · class · L316-L332 — class CoverageFlagTests(unittest.TestCase)
- test_recent_thin_weeks_are_flagged · method · L317-L325 — def test_recent_thin_weeks_are_flagged(self)
- test_steady_series_flags_nothing · method · L327-L329 — def test_steady_series_flags_nothing(self)
- test_empty_input · method · L331-L332 — def test_empty_input(self)
- PangoHelperTests · class · L335-L368 — class PangoHelperTests(unittest.TestCase)
- test_unalias_expands_one_level · method · L346-L347 — def test_unalias_expands_one_level(self)
- test_unalias_full_walks_to_a_fixed_point · method · L349-L350 — def test_unalias_full_walks_to_a_fixed_point(self)
- test_unalias_stops_at_a_recombinant · method · L352-L354 — def test_unalias_stops_at_a_recombinant(self): # A recombinant's alias entry is a list of parents, not a path.
- test_unalias_leaves_root_lineages_alone · method · L356-L357 — def test_unalias_leaves_root_lineages_alone(self)
- test_recombinant_parents_deduplicated · method · L359-L362 — def test_recombinant_parents_deduplicated(self)
- test_ordinary_lineage_has_no_recombinant_parents · method · L364-L365 — def test_ordinary_lineage_has_no_recombinant_parents(self)
- test_unknown_prefix_is_returned_unchanged · method · L367-L368 — def test_unknown_prefix_is_returned_unchanged(self)
- LineageTreeTests · class · L371-L399 — class LineageTreeTests(unittest.TestCase)
- test_parent_chain_walks_to_the_root · method · L380-L383 — def test_parent_chain_walks_to_the_root(self)
- test_root_has_no_parents · method · L385-L386 — def test_root_has_no_parents(self)
- test_descendants_are_transitive · method · L388-L392 — def test_descendants_are_transitive(self)
- test_leaf_has_no_descendants · method · L394-L395 — def test_leaf_has_no_descendants(self)
- test_cycle_does_not_hang · method · L397-L399 — def test_cycle_does_not_hang(self)
- TopValuesTests · class · L402-L427 — class TopValuesTests(unittest.TestCase)
- test_ranked_by_count · method · L411-L415 — def test_ranked_by_count(self)
- test_null_and_empty_calls_excluded · method · L417-L421 — def test_null_and_empty_calls_excluded(self): # An unassigned lineage is the most common "value" in some windows and # is never the answer to "what is circulating".
- test_limit_respected · method · L423-L424 — def test_limit_respected(self)
- test_empty_input · method · L426-L427 — def test_empty_input(self)
- ChildrenMapTests · class · L430-L449 — class ChildrenMapTests(unittest.TestCase)
- test_map_inverts_the_definition · method · L438-L442 — def test_map_inverts_the_definition(self)
- test_prebuilt_map_gives_the_same_answer · method · L444-L449 — def test_prebuilt_map_gives_the_same_answer(self)
- LineageNotesTests · class · L452-L480 — class LineageNotesTests(unittest.TestCase)
- test_parses_status_and_strips_the_marker · method · L461-L467 — def test_parses_status_and_strips_the_marker(self)
- test_header_and_blank_lines_ignored · method · L469-L472 — def test_header_and_blank_lines_ignored(self)
- test_redesignation_target_is_extracted · method · L474-L477 — def test_redesignation_target_is_extracted(self)
- test_withdrawal_without_a_successor · method · L479-L480 — def test_withdrawal_without_a_successor(self)
- PangoProvenanceTests · class · L483-L499 — class PangoProvenanceTests(unittest.TestCase)
- test_blob_hashes_reported_per_file · method · L484-L495 — def test_blob_hashes_reported_per_file(self)
- test_no_fetch_yields_empty_provenance · method · L497-L499 — def test_no_fetch_yields_empty_provenance(self)
- ErrorSurfacingTests · class · L502-L526 — class ErrorSurfacingTests(unittest.TestCase)
- test_wrapped_envelope_detail_extracted · method · L503-L508 — def test_wrapped_envelope_detail_extracted(self)
- test_bare_rfc7807_detail_extracted · method · L510-L512 — def test_bare_rfc7807_detail_extracted(self)
- test_non_json_body_does_not_raise · method · L514-L515 — def test_non_json_body_does_not_raise(self)
- test_unknown_instance_lists_the_known_ones · method · L517-L520 — def test_unknown_instance_lists_the_known_ones(self)
- test_base_url_overrides_the_registry · method · L522-L526 — def test_base_url_overrides_the_registry(self)
- QueryEncodingTests · class · L529-L539 — class QueryEncodingTests(unittest.TestCase)
- test_list_values_repeat_the_key · method · L530-L532 — def test_list_values_repeat_the_key(self)
- test_none_values_dropped · method · L534-L535 — def test_none_values_dropped(self)
- test_empty_string_preserved · method · L537-L539 — def test_empty_string_preserved(self): # An empty value is a real filter -- it selects null lineage calls.
- WhereParsingTests · class · L542-L558 — class WhereParsingTests(unittest.TestCase)
- test_valid_field_accepted · method · L543-L546 — def test_valid_field_accepted(self)
- test_range_suffix_accepted · method · L548-L549 — def test_range_suffix_accepted(self)
- test_unknown_field_suggests_alternatives · method · L551-L554 — def test_unknown_field_suggests_alternatives(self)
- test_missing_equals_rejected · method · L556-L558 — def test_missing_equals_rejected(self)
- MonthWindowTests · class · L561-L587 — class MonthWindowTests(unittest.TestCase)
- test_previous_month · method · L562-L567 — def test_previous_month(self)
- test_year_boundary · method · L569-L575 — def test_year_boundary(self)
- test_december_end_computed_correctly · method · L577-L580 — def test_december_end_computed_correctly(self)
- test_leap_february · method · L582-L587 — def test_leap_february(self)
- CohortCurveTests · class · L590-L642 — class CohortCurveTests(unittest.TestCase)
- test_cumulative_fractions_are_monotonic · method · L591-L608 — def test_cumulative_fractions_are_monotonic(self)
- test_submission_before_cohort_end_clamps_to_zero_lag · method · L610-L617 — def test_submission_before_cohort_end_clamps_to_zero_lag(self)
- test_empty_cohort_returns_none · method · L619-L625 — def test_empty_cohort_returns_none(self)
- test_undated_rows_leave_the_denominator_and_are_counted · method · L627-L642 — def test_undated_rows_leave_the_denominator_and_are_counted(self): # Excluding them is right -- they cannot be placed in any lag bucket -- # but the count has to surface so the caller can report it.
- MutationProfileTests · class · L645-L665 — class MutationProfileTests(unittest.TestCase)
- test_gene_filter_is_case_insensitive · method · L653-L658 — def test_gene_filter_is_case_insensitive(self)
- test_no_gene_filter_keeps_everything · method · L660-L665 — def test_no_gene_filter_keeps_everything(self)
- SanitizeTests · class · L668-L705 — class SanitizeTests(unittest.TestCase)
- test_tab_in_a_label_cannot_break_tsv_columns · method · L671-L674 — def test_tab_in_a_label_cannot_break_tsv_columns(self)
- test_newline_cannot_forge_a_row · method · L676-L679 — def test_newline_cannot_forge_a_row(self)
- test_control_characters_stripped · method · L681-L682 — def test_control_characters_stripped(self)
- test_long_values_truncated · method · L684-L686 — def test_long_values_truncated(self)
- test_ordinary_values_unchanged · method · L688-L690 — def test_ordinary_values_unchanged(self)
- test_none_becomes_empty · method · L692-L693 — def test_none_becomes_empty(self)
- test_json_output_stays_faithful · method · L695-L699 — def test_json_output_stays_faithful(self): # The encoder escapes control characters, so JSON consumers get the # exact value rather than a flattened one.
- test_error_detail_is_flattened · method · L701-L705 — def test_error_detail_is_flattened(self)
- OutputFormatTests · class · L708-L726 — class OutputFormatTests(unittest.TestCase)
- test_tsv_has_a_header_and_blank_for_none · method · L711-L714 — def test_tsv_has_a_header_and_blank_for_none(self)
- test_json_round_trips · method · L716-L719 — def test_json_round_trips(self)
- test_table_columns_align · method · L721-L723 — def test_table_columns_align(self)
- test_empty_rows_still_emit_a_header · method · L725-L726 — def test_empty_rows_still_emit_a_header(self)
- PrevalenceCliTests · class · L729-L868 — class PrevalenceCliTests(unittest.TestCase)
- _run · method · L732-L754 — def _run(self, argv, *, lineage_rows=None, date_rows=None, counts=None)
- fake_aggregated · function · L736-L742 — def fake_aggregated(base_url, filters, fields=())
- fake_count · function · L744-L745 — def fake_count(base_url, filters)
- test_window_snaps_to_whole_iso_weeks · method · L756-L771 — def test_window_snaps_to_whole_iso_weeks(self)
- test_aligned_window_is_not_reported_as_widened · method · L773-L778 — def test_aligned_window_is_not_reported_as_widened(self)
- test_discovery_mode_picks_the_commonest_lineages · method · L780-L799 — def test_discovery_mode_picks_the_commonest_lineages(self)
- test_no_names_defaults_to_discovery · method · L801-L812 — def test_no_names_defaults_to_discovery(self)
- test_top_below_one_is_rejected · method · L814-L817 — def test_top_below_one_is_rejected(self)
- test_named_lineages_survive_alongside_top · method · L819-L832 — def test_named_lineages_survive_alongside_top(self)
- test_empty_window_in_discovery_mode_exits_nonzero · method · L834-L841 — def test_empty_window_in_discovery_mode_exits_nonzero(self)
- test_undated_sequences_do_not_fake_a_descendant_note · method · L843-L857 — def test_undated_sequences_do_not_fake_a_descendant_note(self): # Regression: the note used to compare a count() total against the sum # of the weekly bins. Sequences with no collection date are absent from # the bins, so any lineage that had some looked as though it had # descendants it does not.
- test_real_descendants_still_produce_the_note · method · L859-L868 — def test_real_descendants_still_produce_the_note(self)
- ResolveLineageCliTests · class · L871-L905 — class ResolveLineageCliTests(unittest.TestCase)
- _run · method · L872-L876 — def _run(self, argv)
- test_withdrawn_name_exits_nonzero · method · L878-L889 — def test_withdrawn_name_exits_nonzero(self)
- test_current_name_exits_zero · method · L891-L901 — def test_current_name_exits_zero(self)
- test_lowercase_input_is_normalised · method · L903-L905 — def test_lowercase_input_is_normalised(self)
- LiveApiTests · class · L909-L956 — class LiveApiTests(unittest.TestCase)
- test_sublineage_wildcard_expands_on_an_indexed_column · method · L915-L918 — def test_sublineage_wildcard_expands_on_an_indexed_column(self)
- test_wildcard_matches_nothing_without_an_index · method · L920-L923 — def test_wildcard_matches_nothing_without_an_index(self)
- test_sars_date_filter_is_a_400_on_h5n1 · method · L925-L928 — def test_sars_date_filter_is_a_400_on_h5n1(self)
- test_unknown_lineage_rejected_on_an_indexed_column · method · L930-L933 — def test_unknown_lineage_rejected_on_an_indexed_column(self)
- test_lapis_roots_recombinants · method · L935-L938 — def test_lapis_roots_recombinants(self)
- test_alias_key_carries_recombinant_parents · method · L940-L942 — def test_alias_key_carries_recombinant_parents(self)
- test_schemas_declare_different_date_fields · method · L944-L951 — def test_schemas_declare_different_date_fields(self)
- test_every_registered_instance_answers · method · L953-L956 — def test_every_registered_instance_answers(self)