This file contains unit tests for the iTOL plotting utilities in the cassiopeia.plotting.itol_utilities
module. It tests various functions related to generating files for iTOL visualization, including gradient files, colorbar files, and allele heatmaps. The tests also cover the integrated pipeline for uploading and exporting trees to iTOL.
The code is structured as a single test class TestITOLPlotting
that inherits from unittest.TestCase
. It contains several test methods, each testing a specific functionality of the iTOL plotting utilities. The class uses a setUp
method to initialize common test data and a tearDown
method to clean up temporary files.
A test class that contains unit tests for iTOL plotting utilities.
setUp
method, including a temporary directory, random state, indel priors, allele table, and a test tree.tearDown
method.Tests the creation of a gradient file for iTOL visualization.
itol_utilities.create_gradient_from_df
with test data.Tests the creation of a colorbar file for iTOL visualization without a legend.
itol_utilities.create_colorbar
with test data and color map.Tests the creation of a colorbar file for iTOL visualization with a legend.
Similar to test_generate_colorbar_file
, but sets create_legend=True
and verifies the legend content in the output file.
Tests the creation of an allele heatmap with specified colors.
itol_utilities.create_indel_heatmap
with test data and specified colors.Tests the creation of an allele heatmap with specified indel priors.
Similar to test_create_allele_heatmap_specified_colors
, but uses indel priors instead of specified colors.
Tests the creation of an allele heatmap without specifying priors or a color map.
Calls itol_utilities.create_indel_heatmap
with only the basic required parameters and verifies the output files.
Tests the integrated pipeline for uploading and exporting a simple tree to iTOL.
cas.pl.upload_and_export_itol
with a simple tree.Tests the integrated pipeline for uploading and exporting a tree with an allele heatmap to iTOL.
Similar to test_integrated_pipeline_simple_tree
, but includes an allele table in the parameters.
Tests the integrated pipeline for uploading and exporting a tree with metadata to iTOL.
Similar to test_integrated_pipeline_simple_tree
, but includes metadata parameters.
The tests use a configuration file ~/.itolconfig
for iTOL credentials. Some tests are skipped if this file doesn’t exist.
The tests use unittest
assertions to check for expected outcomes and file existence.
The tests create and delete temporary files and directories, which may impact performance on slower file systems.
None explicitly mentioned in the code.
This file contains unit tests for the iTOL plotting utilities in the cassiopeia.plotting.itol_utilities
module. It tests various functions related to generating files for iTOL visualization, including gradient files, colorbar files, and allele heatmaps. The tests also cover the integrated pipeline for uploading and exporting trees to iTOL.
The code is structured as a single test class TestITOLPlotting
that inherits from unittest.TestCase
. It contains several test methods, each testing a specific functionality of the iTOL plotting utilities. The class uses a setUp
method to initialize common test data and a tearDown
method to clean up temporary files.
A test class that contains unit tests for iTOL plotting utilities.
setUp
method, including a temporary directory, random state, indel priors, allele table, and a test tree.tearDown
method.Tests the creation of a gradient file for iTOL visualization.
itol_utilities.create_gradient_from_df
with test data.Tests the creation of a colorbar file for iTOL visualization without a legend.
itol_utilities.create_colorbar
with test data and color map.Tests the creation of a colorbar file for iTOL visualization with a legend.
Similar to test_generate_colorbar_file
, but sets create_legend=True
and verifies the legend content in the output file.
Tests the creation of an allele heatmap with specified colors.
itol_utilities.create_indel_heatmap
with test data and specified colors.Tests the creation of an allele heatmap with specified indel priors.
Similar to test_create_allele_heatmap_specified_colors
, but uses indel priors instead of specified colors.
Tests the creation of an allele heatmap without specifying priors or a color map.
Calls itol_utilities.create_indel_heatmap
with only the basic required parameters and verifies the output files.
Tests the integrated pipeline for uploading and exporting a simple tree to iTOL.
cas.pl.upload_and_export_itol
with a simple tree.Tests the integrated pipeline for uploading and exporting a tree with an allele heatmap to iTOL.
Similar to test_integrated_pipeline_simple_tree
, but includes an allele table in the parameters.
Tests the integrated pipeline for uploading and exporting a tree with metadata to iTOL.
Similar to test_integrated_pipeline_simple_tree
, but includes metadata parameters.
The tests use a configuration file ~/.itolconfig
for iTOL credentials. Some tests are skipped if this file doesn’t exist.
The tests use unittest
assertions to check for expected outcomes and file existence.
The tests create and delete temporary files and directories, which may impact performance on slower file systems.
None explicitly mentioned in the code.