← Về thư mục
tests/phylogenetics/test_scripts.py
- Recorder · class · L49-L74 — class Recorder
- init · method · L52-L56 — def init(self, returncode: int = 0, stderr: str = "", failing: str | None = None)
- call · method · L58-L65 — def call(self, command, **kwargs) -> subprocess.CompletedProcess
- command · method · L68-L70 — def command(self) -> list[str]
- assert_called · method · L72-L74 — def assert_called(self) -> None
- recorded · function · L78-L80 — def recorded(recorder: Recorder)
- ScratchCase · class · L83-L100 — class ScratchCase(unittest.TestCase)
- setUp · method · L84-L87 — def setUp(self) -> None
- fasta · method · L89-L95 — def fasta(self, count: int, name: str | None = None) -> Path
- newick · method · L97-L100 — def newick(self, text: str = FOUR_TAXA, name: str = "tree.nwk") -> Path
- SequenceCountTests · class · L103-L126 — class SequenceCountTests(ScratchCase)
- test_headers_are_counted_not_lines · method · L104-L105 — def test_headers_are_counted_not_lines(self) -> None
- test_an_empty_file_has_no_sequences · method · L107-L110 — def test_an_empty_file_has_no_sequences(self) -> None: # 0 must come back as 0 rather than raise: run_mafft divides the world # into size bands on this number.
- test_a_wrapped_sequence_counts_once · method · L112-L115 — def test_a_wrapped_sequence_counts_once(self) -> None
- test_an_angle_bracket_that_does_not_start_a_line_is_not_a_header · method · L117-L122 — def test_an_angle_bracket_that_does_not_start_a_line_is_not_a_header(self) -> None: # Indented or mid-line ">" appears in quality lines and comments; only a # line-initial one opens a FASTA record.
- test_a_missing_file_raises_rather_than_reporting_zero · method · L124-L126 — def test_a_missing_file_raises_rather_than_reporting_zero(self) -> None
- MafftCommandTests · class · L129-L197 — class MafftCommandTests(ScratchCase)
- align · method · L132-L139 — def align(self, sequences: int, **kwargs) -> list[str]
- test_small_datasets_get_the_accurate_pairwise_strategy · method · L141-L145 — def test_small_datasets_get_the_accurate_pairwise_strategy(self) -> None
- test_the_two_hundred_sequence_boundary_is_inclusive · method · L147-L151 — def test_the_two_hundred_sequence_boundary_is_inclusive(self) -> None: #
n_seqs <= 200 -- 200 still gets --localpair, 201 drops to --auto.
- test_the_thousand_sequence_boundary_is_inclusive · method · L153-L158 — def test_the_thousand_sequence_boundary_is_inclusive(self) -> None: #
n_seqs <= 1000 -- above it MAFFT must drop to the FFT-NS heuristic, # because --auto on a large alignment can run for days.
- test_an_explicit_method_overrides_the_size_bands · method · L160-L163 — def test_an_explicit_method_overrides_the_size_bands(self) -> None
- test_the_thread_count_reaches_mafft_as_a_string · method · L165-L169 — def test_the_thread_count_reaches_mafft_as_a_string(self) -> None
- test_the_input_order_is_preserved_and_the_file_comes_last · method · L171-L179 — def test_the_input_order_is_preserved_and_the_file_comes_last(self) -> None: # Without --inputorder MAFFT reorders the alignment, which silently # breaks any downstream code that pairs it with a metadata table.
- test_the_alignment_is_written_to_the_requested_path · method · L181-L187 — def test_the_alignment_is_written_to_the_requested_path(self) -> None
- test_a_mafft_failure_is_raised_not_swallowed · method · L189-L197 — def test_a_mafft_failure_is_raised_not_swallowed(self) -> None: # Continuing with a truncated alignment would produce a tree from # nothing, so a non-zero exit has to stop the pipeline.
- IqTreeCommandTests · class · L200-L265 — class IqTreeCommandTests(ScratchCase)
- build · method · L201-L209 — def build(self, **kwargs) -> tuple[list[str], str, str]
- test_the_command_carries_the_documented_flags · method · L211-L227 — def test_the_command_carries_the_documented_flags(self) -> None
- test_the_bootstrap_and_thread_counts_are_not_hardcoded · method · L229-L232 — def test_the_bootstrap_and_thread_counts_are_not_hardcoded(self) -> None
- test_an_outgroup_is_passed_only_when_one_is_given · method · L234-L238 — def test_an_outgroup_is_passed_only_when_one_is_given(self) -> None
- test_the_returned_path_is_iqtrees_treefile · method · L240-L242 — def test_the_returned_path_is_iqtrees_treefile(self) -> None
- test_the_selected_model_is_echoed_from_the_log · method · L244-L252 — def test_the_selected_model_is_echoed_from_the_log(self) -> None: # The chosen model is the one result a reader needs to report, and it # only exists in IQ-TREE's log file.
- test_a_missing_log_is_not_an_error · method · L254-L257 — def test_a_missing_log_is_not_an_error(self) -> None
- test_an_iqtree_failure_is_raised · method · L259-L265 — def test_an_iqtree_failure_is_raised(self) -> None
- FastTreeCommandTests · class · L268-L316 — class FastTreeCommandTests(ScratchCase)
- build · method · L269-L277 — def build(self, seq_type: str) -> list[str]
- test_nucleotides_get_the_nucleotide_model · method · L279-L283 — def test_nucleotides_get_the_nucleotide_model(self) -> None: # -nt switches FastTree out of its protein default, and GTR is only # defined for nucleotides.
- test_amino_acids_get_a_protein_model_and_no_nucleotide_flag · method · L285-L291 — def test_amino_acids_get_a_protein_model_and_no_nucleotide_flag(self) -> None: # Passing -nt on protein data makes FastTree read every residue as an # ambiguous base, so the flag must be absent here.
- test_the_alignment_is_the_final_argument · method · L293-L298 — def test_the_alignment_is_the_final_argument(self) -> None
- test_the_tree_path_is_returned_and_created · method · L300-L308 — def test_the_tree_path_is_returned_and_created(self) -> None
- test_a_fasttree_failure_is_raised · method · L310-L316 — def test_a_fasttree_failure_is_raised(self) -> None
- DependencyCheckTests · class · L319-L349 — class DependencyCheckTests(unittest.TestCase)
- test_a_complete_toolchain_reports_success_and_returns · method · L320-L329 — def test_a_complete_toolchain_reports_success_and_returns(self) -> None
- test_a_missing_tool_exits_with_its_install_command · method · L331-L342 — def test_a_missing_tool_exits_with_its_install_command(self) -> None
- test_every_tool_is_probed_by_name_on_the_path · method · L344-L349 — def test_every_tool_is_probed_by_name_on_the_path(self) -> None
- TreeSummaryTests · class · L352-L385 — class TreeSummaryTests(ScratchCase)
- test_the_summary_matches_the_newick_string · method · L353-L363 — def test_the_summary_matches_the_newick_string(self) -> None
- test_the_mean_is_consistent_with_the_total · method · L365-L371 — def test_the_mean_is_consistent_with_the_total(self) -> None
- test_an_unreadable_tree_returns_an_empty_summary · method · L373-L379 — def test_an_unreadable_tree_returns_an_empty_summary(self) -> None: # tree_summary is called for its report, so a bad tree file must not # abort a pipeline that has already produced its outputs.
- test_malformed_newick_returns_an_empty_summary · method · L381-L385 — def test_malformed_newick_returns_an_empty_summary(self) -> None
- VisualisationTests · class · L388-L417 — class VisualisationTests(ScratchCase)
- test_the_rooting_choice_is_reported · method · L389-L402 — def test_the_rooting_choice_is_reported(self) -> None
- test_a_missing_qt_backend_names_the_package_it_needs · method · L404-L417 — def test_a_missing_qt_backend_names_the_package_it_needs(self) -> None
- PipelineWiringTests · class · L420-L503 — class PipelineWiringTests(ScratchCase)
- run_pipeline · method · L423-L442 — def run_pipeline(self, extra: list[str] | None = None) -> tuple[Recorder, mock.Mock]
- test_the_default_run_is_align_then_iqtree · method · L444-L458 — def test_the_default_run_is_align_then_iqtree(self) -> None
- test_fasttree_replaces_iqtree_rather_than_running_alongside_it · method · L460-L462 — def test_fasttree_replaces_iqtree_rather_than_running_alongside_it(self) -> None
- test_the_sequence_type_reaches_fasttrees_model_choice · method · L464-L467 — def test_the_sequence_type_reaches_fasttrees_model_choice(self) -> None
- test_the_outgroup_reaches_both_iqtree_and_the_visualisation · method · L469-L473 — def test_the_outgroup_reaches_both_iqtree_and_the_visualisation(self) -> None
- test_an_unsupported_sequence_type_is_refused_before_any_tool_runs · method · L475-L485 — def test_an_unsupported_sequence_type_is_refused_before_any_tool_runs(self) -> None
- test_an_unsupported_mafft_method_is_refused · method · L487-L503 — def test_an_unsupported_mafft_method_is_refused(self) -> None: # An unknown method would otherwise be interpolated straight into #
--{method} and reach MAFFT as an invalid flag.