tests package
Submodules
tests.test_download module
tests.test_download_from_yaml module
tests.test_query module
Test for query functions.
- class tests.test_query.TestQuery(methodName='runTest')
Bases:
TestCase
Test query functions.
- setUp() None
Set up for query function tests.
- test_parse_query_rq() None
Test parsing a query in rq.
- test_parse_query_rq_parameterized = None
- test_parse_query_rq_parameterized_0_title() None
Test parsing a query with parameters [with key=’title’, value=’some title’].
- test_parse_query_rq_parameterized_1_description() None
Test parsing a query with parameters [with key=’description’, value=’what is it’].
- test_parse_query_rq_parameterized_2_endpoint() None
Test parsing a query with parameters [with key=’endpoint’, value=’http://zombo.com’].
- test_parse_query_rq_parameterized_3_query() None
Test parsing a query with parameters [with key=’query’, value=’SELECT (COUNT(?v2) AS ?v1) ?v0...category> ?v0n} GROUP BY ?v0n’].
- test_parse_query_rq_should_return_dict() None
Test parsing a query in rq and returning a dict.
- test_result_dict_to_tsv_makes_correct_file()
Test that result_dict converts a TSV, as expected.
- test_result_dict_to_tsv_makes_file()
Test that result_dict converts to TSV.
- tests.test_query.load_obj(name)
Load an object from a pickle.
- tests.test_query.save_obj(obj, name)
Save an object as a pickle.
tests.test_run module
Tests for the run.py script defining the CLI.
tests.test_traits module
Test the traits transform.
- class tests.test_traits.TestTraits(methodName='runTest')
Bases:
TestCase
Test the traits transformation.
- setUp() None
Set up the transformation test.
- test_edges_file(*args)
Test structure of the edges file.
- test_nodes_are_not_repeated()
Test that nodes are not repeated.
- test_nodes_file()
Test structure of the nodes file.
- test_parse_traits_line = None
- test_parse_traits_line_00_species_tax_id()
Test parsing traits line [with key=’species_tax_id’, value=’256826’].
- test_parse_traits_line_01_data_source()
Test parsing traits line [with key=’data_source’, value=’methanogen’].
- test_parse_traits_line_02_org_name()
Test parsing traits line [with key=’org_name’, value=’Methanobacterium aarhusense’].
- test_parse_traits_line_03_species()
Test parsing traits line [with key=’species’, value=’Methanobacterium aarhusense’].
- test_parse_traits_line_04_genus()
Test parsing traits line [with key=’genus’, value=’Methanobacterium’].
- test_parse_traits_line_05_family()
Test parsing traits line [with key=’family’, value=’Methanobacteriaceae’].
- test_parse_traits_line_06_order()
Test parsing traits line [with key=’order’, value=’Methanobacteriales’].
- test_parse_traits_line_07_class()
Test parsing traits line [with key=’class’, value=’Methanobacteria’].
- test_parse_traits_line_08_phylum()
Test parsing traits line [with key=’phylum’, value=’Euryarchaeota’].
- test_parse_traits_line_09_superkingdom()
Test parsing traits line [with key=’superkingdom’, value=’Archaea’].
- test_parse_traits_line_10_gram_stain()
Test parsing traits line [with key=’gram_stain’, value=’positive’].
- test_parse_traits_line_11_metabolism()
Test parsing traits line [with key=’metabolism’, value=’anaerobic’].
- test_parse_traits_line_12_pathways()
Test parsing traits line [with key=’pathways’, value=’methanogenesis’].
- test_parse_traits_line_13_carbon_substrates()
Test parsing traits line [with key=’carbon_substrates’, value=’H2_CO2’].
- test_parse_traits_line_14_sporulation()
Test parsing traits line [with key=’sporulation’, value=’NA’].
- test_parse_traits_line_15_motility()
Test parsing traits line [with key=’motility’, value=’no’].
- test_parse_traits_line_16_range_tmp()
Test parsing traits line [with key=’range_tmp’, value=’NA’].
- test_parse_traits_line_17_range_salinity()
Test parsing traits line [with key=’range_salinity’, value=’NA’].
- test_parse_traits_line_18_cell_shape()
Test parsing traits line [with key=’cell_shape’, value=’bacillus’].
- test_parse_traits_line_19_isolation_source()
Test parsing traits line [with key=’isolation_source’, value=’NA’].
- test_parse_traits_line_20_d1_lo()
Test parsing traits line [with key=’d1_lo’, value=’0.7’].
- test_parse_traits_line_21_d1_up()
Test parsing traits line [with key=’d1_up’, value=’0.7’].
- test_parse_traits_line_22_d2_lo()
Test parsing traits line [with key=’d2_lo’, value=’5’].
- test_parse_traits_line_23_d2_up()
Test parsing traits line [with key=’d2_up’, value=’18’].
- test_parse_traits_line_24_doubling_h()
Test parsing traits line [with key=’doubling_h’, value=’NA’].
- test_parse_traits_line_25_genome_size()
Test parsing traits line [with key=’genome_size’, value=’NA’].
- test_parse_traits_line_26_gc_content()
Test parsing traits line [with key=’gc_content’, value=’NA’].
- test_parse_traits_line_27_coding_genes()
Test parsing traits line [with key=’coding_genes’, value=’NA’].
- test_parse_traits_line_28_optimum_tmp()
Test parsing traits line [with key=’optimum_tmp’, value=’45’].
- test_parse_traits_line_29_optimum_ph()
Test parsing traits line [with key=’optimum_ph’, value=’7.75’].
- test_parse_traits_line_30_growth_tmp()
Test parsing traits line [with key=’growth_tmp’, value=’NA’].
- test_parse_traits_line_31_rRNA16S_genes()
Test parsing traits line [with key=’rRNA16S_genes’, value=’NA’].
- test_parse_traits_line_32_tRNA_genes()
Test parsing traits line [with key=’tRNA_genes’, value=’NA’].
- test_parse_traits_line_33_ref_id()
Test parsing traits line [with key=’ref_id’, value=’19751’].
- test_run()
Test running the transformation.
tests.test_transform_class module
Test the parent Transform class.
- class tests.test_transform_class.TestTransform(methodName='runTest')
Bases:
TestCase
Tests for all transform child classes.
- setUp() None
Set up the transform tests.
- test_attributes = None
- test_attributes_0_source_name()
Test the attributes of a Transform instance [with attr=’source_name’, default=’test_transform’].
- test_attributes_1_node_header()
Test the attributes of a Transform instance [with attr=’node_header’, default=[‘id’, ‘name’, ‘category’]].
- test_attributes_2_edge_header()
Test the attributes of a Transform instance [with attr=’edge_header’, default=[‘subject’, ‘predicate’, ‘object’, ‘relation’]].
- test_attributes_3_output_base_dir()
Test the attributes of a Transform instance [with attr=’output_base_dir’, default=’data/transformed’].
- test_attributes_4_input_base_dir()
Test the attributes of a Transform instance [with attr=’input_base_dir’, default=’data/raw’].
- test_attributes_5_output_dir()
Test the attributes of a Transform instance [with attr=’output_dir’, default=’data/transformed/test_transform’].
- test_attributes_6_output_node_file()
Test the attributes of a Transform instance [with attr=’output_node_file’, default=’data/transformed/test_transform/nodes.tsv’].
- test_attributes_7_output_edge_file()
Test the attributes of a Transform instance [with attr=’output_edge_file’, default=’data/transformed/test_transform/edges.tsv’].
- test_attributes_8_output_json_file()
Test the attributes of a Transform instance [with attr=’output_json_file’, default=’data/transformed/test_transform/nodes_edges.json’].
- test_default_dir = None
- test_default_dir_0_DEFAULT_INPUT_DIR()
Test the default directory [with dir_var_name=’DEFAULT_INPUT_DIR’, dir_var_value=’data/raw’].
- test_default_dir_1_DEFAULT_OUTPUT_DIR()
Test the default directory [with dir_var_name=’DEFAULT_OUTPUT_DIR’, dir_var_value=’data/transformed’].
- test_reality()
Test the nature of reality.
- test_transform_child_classes = None
- test_transform_child_classes_0_ChebiTransform()
Test whether Transform child classes work as expected [with src_name=’ChebiTransform’].
Make sure Transform child classes: - properly set default input_dir and output_dir - properly pass and set input_dir and output from constructor - implement run() :param src_name: :return: None
- test_transform_child_classes_1_NCBITransform()
Test whether Transform child classes work as expected [with src_name=’NCBITransform’].
Make sure Transform child classes: - properly set default input_dir and output_dir - properly pass and set input_dir and output from constructor - implement run() :param src_name: :return: None
- test_transform_child_classes_2_EnvoTransform()
Test whether Transform child classes work as expected [with src_name=’EnvoTransform’].
Make sure Transform child classes: - properly set default input_dir and output_dir - properly pass and set input_dir and output from constructor - implement run() :param src_name: :return: None
- test_transform_child_classes_3_GoTransform()
Test whether Transform child classes work as expected [with src_name=’GoTransform’].
Make sure Transform child classes: - properly set default input_dir and output_dir - properly pass and set input_dir and output from constructor - implement run() :param src_name: :return: None
- test_transform_child_classes_4_TraitsTransform()
Test whether Transform child classes work as expected [with src_name=’TraitsTransform’].
Make sure Transform child classes: - properly set default input_dir and output_dir - properly pass and set input_dir and output from constructor - implement run() :param src_name: :return: None
tests.test_transform_utils module
Test the transformation utilities.
- class tests.test_transform_utils.TestTransformUtils(methodName='runTest')
Bases:
TestCase
Tests for running transform utilities.
- test_collapse_uniprot_curie = None
- test_collapse_uniprot_curie_0_foobar()
Test for collapsing a UniProtKB curie [with curie=’foobar’, collapsed_curie=’foobar’].
- test_collapse_uniprot_curie_1_ENSEMBL_ENSG00000178607()
Test for collapsing a UniProtKB curie [with curie=’ENSEMBL:ENSG00000178607’, collapsed_curie=’ENSEMBL:ENSG00000178607’].
- test_collapse_uniprot_curie_2_UniprotKB_P63151_1()
Test for collapsing a UniProtKB curie [with curie=’UniprotKB:P63151-1’, collapsed_curie=’UniprotKB:P63151’].
- test_collapse_uniprot_curie_3_uniprotkb_P63151_1()
Test for collapsing a UniProtKB curie [with curie=’uniprotkb:P63151-1’, collapsed_curie=’uniprotkb:P63151’].
- test_collapse_uniprot_curie_4_UniprotKB_P63151_2()
Test for collapsing a UniProtKB curie [with curie=’UniprotKB:P63151-2’, collapsed_curie=’UniprotKB:P63151’].
- test_guess_bl_category = None
- test_guess_bl_category_0_()
Test inference of Biolink categories for a CURIE [with curie=’’, category=’biolink:NamedThing’].
- test_guess_bl_category_1_UniProtKB()
Test inference of Biolink categories for a CURIE [with curie=’UniProtKB’, category=’biolink:Protein’].
- test_guess_bl_category_2_ComplexPortal()
Test inference of Biolink categories for a CURIE [with curie=’ComplexPortal’, category=’biolink:Protein’].
- test_guess_bl_category_3_GO()
Test inference of Biolink categories for a CURIE [with curie=’GO’, category=’biolink:OntologyClass’].
tests.test_version module
Module contents
Initialize the tests.