← Về thư mục
- TreeFixtureCase · class · L55-L66 — class TreeFixtureCase(unittest.TestCase)
- setUp · method · L58-L61 — def setUp(self) -> None
- newick · method · L63-L66 — def newick(self, text: str, name: str = "tree.nwk") -> Path
- ParserSpecTests · class · L69-L93 — class ParserSpecTests(unittest.TestCase)
- test_a_numeric_parser_id_stays_an_integer · method · L72-L76 — def test_a_numeric_parser_id_stays_an_integer(self) -> None: # ETE looks parsers up by int; passing "0" as a string selects nothing.
- test_a_named_parser_stays_a_string · method · L78-L79 — def test_a_named_parser_stays_a_string(self) -> None
- test_an_empty_parser_is_rejected · method · L81-L85 — def test_an_empty_parser_is_rejected(self) -> None
- test_both_scripts_agree_on_the_parser_type · method · L87-L93 — def test_both_scripts_agree_on_the_parser_type(self) -> None: # The two CLIs define the converter separately; a divergence would make #
--parser 1 mean different things in stats and in quick_visualize.
- CommaSeparatedTests · class · L96-L106 — class CommaSeparatedTests(unittest.TestCase)
- test_whitespace_and_empty_fields_are_dropped · method · L97-L101 — def test_whitespace_and_empty_fields_are_dropped(self) -> None
- test_an_empty_string_selects_no_properties · method · L103-L106 — def test_an_empty_string_selects_no_properties(self) -> None: #
--props "" must mean "none", not a single empty property name, or # tree.write() is asked for a property no node has.
- ModeSpecTests · class · L109-L124 — class ModeSpecTests(unittest.TestCase)
- test_short_and_long_layout_names_normalise_to_the_long_form · method · L110-L116 — def test_short_and_long_layout_names_normalise_to_the_long_form(self) -> None
- test_an_unknown_layout_is_rejected · method · L118-L124 — def test_an_unknown_layout_is_rejected(self) -> None
- TreeLoadingTests · class · L127-L152 — class TreeLoadingTests(TreeFixtureCase)
- test_a_valid_newick_file_loads_with_its_leaves · method · L128-L130 — def test_a_valid_newick_file_loads_with_its_leaves(self) -> None
- test_a_missing_file_is_reported_as_user_error · method · L132-L134 — def test_a_missing_file_is_reported_as_user_error(self) -> None
- test_a_directory_is_not_a_tree · method · L136-L138 — def test_a_directory_is_not_a_tree(self) -> None
- test_malformed_newick_becomes_a_user_error_not_a_traceback · method · L140-L145 — def test_malformed_newick_becomes_a_user_error_not_a_traceback(self) -> None: # A truncated tree is the commonest real failure; the CLI must name the # file and the parser rather than surfacing NewickError.
- test_both_scripts_load_trees_identically · method · L147-L152 — def test_both_scripts_load_trees_identically(self) -> None
- NumericSummaryTests · class · L155-L172 — class NumericSummaryTests(unittest.TestCase)
- test_an_empty_list_summarises_to_none_rather_than_raising · method · L156-L159 — def test_an_empty_list_summarises_to_none_rather_than_raising(self) -> None: # A tree with no branch lengths at all must report "none", not crash in # statistics.fmean on an empty sequence.
- test_the_four_statistics_are_the_textbook_ones · method · L161-L166 — def test_the_four_statistics_are_the_textbook_ones(self) -> None
- test_a_single_value_is_its_own_summary · method · L168-L172 — def test_a_single_value_is_its_own_summary(self) -> None
- TreeStatsTests · class · L175-L244 — class TreeStatsTests(TreeFixtureCase)
- stats · method · L178-L180 — def stats(self, text: str, parser: int = 1) -> dict
- test_the_node_counts_match_the_newick_string · method · L182-L190 — def test_the_node_counts_match_the_newick_string(self) -> None
- test_branch_length_statistics_exclude_the_root · method · L192-L198 — def test_branch_length_statistics_exclude_the_root(self) -> None: # Six non-root branches: AB=1, A=1, B=1, CD=1, C=2, D=2.
- test_the_farthest_leaf_distance_is_the_root_to_tip_path · method · L200-L204 — def test_the_farthest_leaf_distance_is_the_root_to_tip_path(self) -> None
- test_a_polytomy_is_counted_and_a_bifurcating_tree_reports_none · method · L206-L208 — def test_a_polytomy_is_counted_and_a_bifurcating_tree_reports_none(self) -> None
- test_a_unary_node_is_counted · method · L210-L215 — def test_a_unary_node_is_counted(self) -> None: # Single-child nodes survive some pruning routines and break downstream # tools, so they get their own counter.
- test_duplicate_leaf_names_are_listed_once_each · method · L217-L219 — def test_duplicate_leaf_names_are_listed_once_each(self) -> None
- test_unnamed_leaves_are_reported_by_position · method · L221-L224 — def test_unnamed_leaves_are_reported_by_position(self) -> None: # An unnamed leaf has no name to report, so the node id (the path of # child indices from the root) identifies it instead.
- test_the_parser_number_decides_whether_a_label_is_a_name_or_support · method · L226-L237 — def test_the_parser_number_decides_whether_a_label_is_a_name_or_support(self) -> None: # Parser 1 reads "AB"/"CD" as internal names, so no support exists; # parser 0 reads the same position as a support value. Getting this # backwards silently reports support statistics for a tree that has # none, or none for a tree that has them.
- test_the_reported_source_and_version_identify_the_run · method · L239-L244 — def test_the_reported_source_and_version_identify_the_run(self) -> None
- PrintStatsTests · class · L247-L267 — class PrintStatsTests(TreeFixtureCase)
- test_json_output_is_machine_readable_and_complete · method · L248-L254 — def test_json_output_is_machine_readable_and_complete(self) -> None
- test_text_output_says_none_where_a_summary_is_missing · method · L256-L267 — def test_text_output_says_none_where_a_summary_is_missing(self) -> None: # Parser 1 leaves support unset; the text report must say so rather # than crash formatting None.
- NodeResolutionTests · class · L270-L286 — class NodeResolutionTests(TreeFixtureCase)
- test_a_unique_name_resolves_to_that_node · method · L271-L274 — def test_a_unique_name_resolves_to_that_node(self) -> None
- test_an_absent_name_is_refused · method · L276-L279 — def test_an_absent_name_is_refused(self) -> None
- test_an_ambiguous_name_is_refused_rather_than_silently_taking_the_first · method · L281-L286 — def test_an_ambiguous_name_is_refused_rather_than_silently_taking_the_first(self) -> None: # Rooting on "whichever A ETE traversed first" would give a different # tree run to run, so a duplicate name has to be an error.
- KeepNameTests · class · L289-L319 — class KeepNameTests(TreeFixtureCase)
- test_names_passed_on_the_command_line_are_returned_in_order · method · L290-L291 — def test_names_passed_on_the_command_line_are_returned_in_order(self) -> None
- test_a_taxon_file_skips_blank_lines_and_comments · method · L293-L296 — def test_a_taxon_file_skips_blank_lines_and_comments(self) -> None
- test_an_empty_request_is_refused · method · L298-L304 — def test_an_empty_request_is_refused(self) -> None
- test_a_taxon_file_of_only_comments_is_refused · method · L306-L310 — def test_a_taxon_file_of_only_comments_is_refused(self) -> None
- test_duplicate_requests_are_refused · method · L312-L315 — def test_duplicate_requests_are_refused(self) -> None: #
prune --keep A A would silently retain one leaf while reporting two.
- test_a_missing_taxon_file_is_refused · method · L317-L319 — def test_a_missing_taxon_file_is_refused(self) -> None
- RequestedNameValidationTests · class · L322-L336 — class RequestedNameValidationTests(TreeFixtureCase)
- test_names_that_all_resolve_pass_silently · method · L323-L325 — def test_names_that_all_resolve_pass_silently(self) -> None
- test_an_internal_node_name_is_not_a_leaf · method · L327-L331 — def test_an_internal_node_name_is_not_a_leaf(self) -> None: #
prune works on leaf names; "AB" exists in the tree but is not one.
- test_a_leaf_name_duplicated_in_the_tree_is_refused · method · L333-L336 — def test_a_leaf_name_duplicated_in_the_tree_is_refused(self) -> None
- SaveTreeTests · class · L339-L363 — class SaveTreeTests(TreeFixtureCase)
- test_a_saved_tree_reloads_with_the_same_topology · method · L340-L350 — def test_a_saved_tree_reloads_with_the_same_topology(self) -> None
- test_the_file_ends_in_exactly_one_newline · method · L352-L358 — def test_the_file_ends_in_exactly_one_newline(self) -> None
- test_a_missing_output_directory_is_refused_before_writing · method · L360-L363 — def test_a_missing_output_directory_is_refused_before_writing(self) -> None
- CommandLineTests · class · L366-L582 — class CommandLineTests(TreeFixtureCase)
- run_main · method · L369-L373 — def run_main(self, argv: list[str]) -> tuple[int, str, str]
- test_a_missing_input_exits_two_with_a_message_on_stderr · method · L375-L378 — def test_a_missing_input_exits_two_with_a_message_on_stderr(self) -> None
- test_stats_json_round_trips_through_the_cli · method · L380-L385 — def test_stats_json_round_trips_through_the_cli(self) -> None
- test_the_wrong_parser_number_is_reported_rather_than_guessed · method · L387-L393 — def test_the_wrong_parser_number_is_reported_rather_than_guessed(self) -> None: # BALANCED labels its internal nodes, so parser 0 -- which reads that # position as a support value -- cannot convert "AB" to a float. Falling # back to another parser would silently reinterpret the tree.
- test_leaves_prints_one_name_per_line · method · L395-L398 — def test_leaves_prints_one_name_per_line(self) -> None
- test_an_unnamed_leaf_still_occupies_a_line · method · L400-L404 — def test_an_unnamed_leaf_still_occupies_a_line(self) -> None: # Otherwise the leaf count and the line count disagree downstream.
- test_the_ascii_drawing_contains_every_leaf · method · L406-L410 — def test_the_ascii_drawing_contains_every_leaf(self) -> None
- test_identical_trees_have_a_robinson_foulds_distance_of_zero · method · L412-L419 — def test_identical_trees_have_a_robinson_foulds_distance_of_zero(self) -> None
- test_the_two_distinct_four_taxon_topologies_are_maximally_apart · method · L421-L433 — def test_the_two_distinct_four_taxon_topologies_are_maximally_apart(self) -> None: # Unrooted, ((A,B),(C,D)) and ((A,C),(B,D)) each have exactly one # non-trivial split and the splits differ, so RF = 1 + 1 = 2 and the # maximum possible RF for four taxa is also 2.
- test_comparing_a_tree_with_duplicate_names_is_refused · method · L435-L442 — def test_comparing_a_tree_with_duplicate_names_is_refused(self) -> None: # Robinson-Foulds is defined over sets of leaf labels; duplicates make # the split sets meaningless, so the comparison must not run.
- test_comparing_a_tree_with_unnamed_leaves_is_refused · method · L444-L449 — def test_comparing_a_tree_with_unnamed_leaves_is_refused(self) -> None
- test_pruning_keeps_only_the_requested_leaves · method · L451-L469 — def test_pruning_keeps_only_the_requested_leaves(self) -> None
- test_pruning_preserves_the_path_length_between_retained_leaves · method · L471-L490 — def test_pruning_preserves_the_path_length_between_retained_leaves(self) -> None: # A--B is 1+1 = 2 in the input; with --preserve-branch-length the # collapsed internal node's length must be folded in, not discarded.
- test_pruning_to_an_absent_leaf_is_refused · method · L492-L503 — def test_pruning_to_an_absent_leaf_is_refused(self) -> None
- test_rerooting_on_an_outgroup_preserves_the_leaves_and_total_length · method · L505-L527 — def test_rerooting_on_an_outgroup_preserves_the_leaves_and_total_length(self) -> None: # Rerooting relocates the root along an existing branch; it must not # create, destroy, or rescale any evolutionary distance.
- test_midpoint_rooting_reports_which_midpoint_it_used · method · L529-L547 — def test_midpoint_rooting_reports_which_midpoint_it_used(self) -> None
- test_topological_without_midpoint_is_refused · method · L549-L563 — def test_topological_without_midpoint_is_refused(self) -> None: # --topological only changes how the midpoint is found, so pairing it # with --outgroup would silently do nothing.
- test_converting_between_parsers_keeps_the_leaf_set · method · L565-L582 — def test_converting_between_parsers_keeps_the_leaf_set(self) -> None
- BindAddressTests · class · L585-L620 — class BindAddressTests(unittest.TestCase)
- test_every_loopback_spelling_is_allowed_without_the_opt_in · method · L588-L594 — def test_every_loopback_spelling_is_allowed_without_the_opt_in(self) -> None: # A validator that rejected these would make the default
--host # 127.0.0.1 unusable, so the permissive direction matters as much as # the restrictive one.
- test_the_wildcard_address_is_refused_without_the_opt_in · method · L596-L599 — def test_the_wildcard_address_is_refused_without_the_opt_in(self) -> None: # 0.0.0.0 is not loopback: it publishes the viewer on every interface.
- test_routable_addresses_are_refused_without_the_opt_in · method · L601-L605 — def test_routable_addresses_are_refused_without_the_opt_in(self) -> None
- test_a_host_name_that_merely_starts_with_localhost_is_refused · method · L607-L615 — def test_a_host_name_that_merely_starts_with_localhost_is_refused(self) -> None: # "localhost.example.com" resolves wherever its DNS says; only the # exact name is treated as loopback.
- test_the_opt_in_permits_exactly_what_it_says · method · L617-L620 — def test_the_opt_in_permits_exactly_what_it_says(self) -> None
- SupportFractionTests · class · L623-L637 — class SupportFractionTests(unittest.TestCase)
- test_percentages_are_normalised_and_fractions_left_alone · method · L624-L629 — def test_percentages_are_normalised_and_fractions_left_alone(self) -> None: # Bootstrap support is written both as 0-1 and as 0-100; colouring by # support has to mean the same thing either way.
- test_the_boundary_value_one_is_treated_as_a_fraction · method · L631-L633 — def test_the_boundary_value_one_is_treated_as_a_fraction(self) -> None: #
numeric > 1 -- a support of exactly 1 is full support, not 1%.
- test_zero_support_stays_zero_and_missing_support_stays_none · method · L635-L637 — def test_zero_support_stays_zero_and_missing_support_stays_none(self) -> None
- SupportColorTests · class · L640-L685 — class SupportColorTests(TreeFixtureCase)
- args · method · L641-L644 — def args(self, extra: list[str] | None = None) -> argparse.Namespace
- test_each_support_band_gets_its_own_colour · method · L646-L659 — def test_each_support_band_gets_its_own_colour(self) -> None
- test_a_node_with_no_support_gets_the_missing_colour · method · L661-L668 — def test_a_node_with_no_support_gets_the_missing_colour(self) -> None
- test_custom_thresholds_move_the_bands · method · L670-L685 — def test_custom_thresholds_move_the_bands(self) -> None
- ValidateArgsTests · class · L688-L756 — class ValidateArgsTests(unittest.TestCase)
- args · method · L689-L690 — def args(self, extra: list[str] | None = None) -> argparse.Namespace
- test_the_shipped_defaults_validate · method · L692-L695 — def test_the_shipped_defaults_validate(self) -> None: # If the defaults failed their own validator the CLI would be unusable # with no arguments at all.
- test_support_thresholds_must_be_ordered_and_within_zero_to_one · method · L697-L707 — def test_support_thresholds_must_be_ordered_and_within_zero_to_one(self) -> None
- test_equal_thresholds_are_allowed · method · L709-L714 — def test_equal_thresholds_are_allowed(self) -> None: # The comparison chain is <=, so a single cut-off between "high" and # "low" is a legitimate configuration.
- test_negative_sizes_are_refused_and_zero_is_allowed · method · L716-L724 — def test_negative_sizes_are_refused_and_zero_is_allowed(self) -> None
- test_dimensions_must_be_positive_when_given · method · L726-L733 — def test_dimensions_must_be_positive_when_given(self) -> None
- test_the_port_range_is_the_tcp_range · method · L735-L742 — def test_the_port_range_is_the_tcp_range(self) -> None
- test_the_arc_bounds_are_degrees · method · L744-L756 — def test_the_arc_bounds_are_degrees(self) -> None
- EngineChoiceTests · class · L759-L794 — class EngineChoiceTests(unittest.TestCase)
- args · method · L760-L761 — def args(self, extra: list[str]) -> argparse.Namespace
- test_no_output_means_the_interactive_engine · method · L763-L764 — def test_no_output_means_the_interactive_engine(self) -> None
- test_the_suffix_picks_the_engine_that_can_write_it · method · L766-L773 — def test_the_suffix_picks_the_engine_that_can_write_it(self) -> None: # SmartView only screenshots PNG; vector output needs Qt treeview.
- test_suffix_matching_is_case_insensitive · method · L775-L776 — def test_suffix_matching_is_case_insensitive(self) -> None
- test_an_unwritable_suffix_is_refused_rather_than_guessed · method · L778-L784 — def test_an_unwritable_suffix_is_refused_rather_than_guessed(self) -> None
- test_an_explicit_engine_overrides_the_suffix · method · L786-L794 — def test_an_explicit_engine_overrides_the_suffix(self) -> None
- RenderDestinationTests · class · L797-L837 — class RenderDestinationTests(TreeFixtureCase)
- args · method · L800-L801 — def args(self, extra: list[str] | None = None) -> argparse.Namespace
- setUp · method · L803-L805 — def setUp(self) -> None
- test_smartview_refuses_a_non_png_destination · method · L807-L811 — def test_smartview_refuses_a_non_png_destination(self) -> None
- test_smartview_refuses_a_missing_output_directory · method · L813-L817 — def test_smartview_refuses_a_missing_output_directory(self) -> None
- test_treeview_refuses_a_suffix_it_cannot_write · method · L819-L821 — def test_treeview_refuses_a_suffix_it_cannot_write(self) -> None
- test_treeview_refuses_a_missing_output_directory · method · L823-L827 — def test_treeview_refuses_a_missing_output_directory(self) -> None
- test_the_missing_qt_extra_is_reported_as_an_install_hint · method · L829-L837 — def test_the_missing_qt_extra_is_reported_as_an_install_hint(self) -> None
- SmartViewLayoutTests · class · L840-L908 — class SmartViewLayoutTests(TreeFixtureCase)
- args · method · L843-L844 — def args(self, extra: list[str] | None = None) -> argparse.Namespace
- elements · method · L846-L847 — def elements(self, args: argparse.Namespace) -> list
- style · method · L849-L852 — def style(self, args: argparse.Namespace) -> dict: # ete4's Layout prepends its own DEFAULT_TREE_STYLE, so the style the # script yields is the second element.
- test_the_layout_mode_becomes_the_smartview_shape · method · L854-L856 — def test_the_layout_mode_becomes_the_smartview_shape(self) -> None
- test_arc_options_are_only_emitted_for_the_circular_layout · method · L858-L865 — def test_arc_options_are_only_emitted_for_the_circular_layout(self) -> None: # A rectangular tree has no arc; passing angle keys would be ignored at # best and misread at worst.
- test_collapse_thresholds_are_passed_through_unchanged · method · L867-L870 — def test_collapse_thresholds_are_passed_through_unchanged(self) -> None
- dots · method · L872-L885 — def dots(self, args: argparse.Namespace, newick: str, parser: int = 0) -> dict
- test_leaves_and_internal_nodes_get_their_own_colour_and_size · method · L887-L893 — def test_leaves_and_internal_nodes_get_their_own_colour_and_size(self) -> None
- test_colour_by_support_repaints_internal_nodes_only · method · L895-L902 — def test_colour_by_support_repaints_internal_nodes_only(self) -> None: # Leaves have no bootstrap support, so they must keep the leaf colour # even when --color-by-support is on.
- test_a_title_adds_a_header_face_and_no_title_adds_nothing · method · L904-L908 — def test_a_title_adds_a_header_face_and_no_title_adds_nothing(self) -> None: # An empty --title must not yield a blank face that reserves header space.